Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想修剪标题视野。
标题字段来自"teaser view mode"我想要它使用template_preprocess_node。
"teaser view mode"
template_preprocess_node
我用了:
if ($vars['type'] == 'deals' && $vars['view_mode'] == 'teaser') { $vars['title'] = truncate_utf8($vars['title'], 30, TRUE, TRUE); }
但它没有反映。
一切对我来说都很好。
确保在您的template_preprocess_node定义中,您&$vars不只是$vars.
&$vars
$vars