【问题标题】:Display article teaser Drupal 7显示文章预告片 Drupal 7
【发布时间】:2016-04-13 13:27:18
【问题描述】:
您好,我正在使用 drupal 7。
我正在根据它们的分类法和带有views_embed_view()的标签显示一些文章。当我创建我的视图时,我告诉我想显示一篇文章预告片,但它总是显示所有内容。
有解决办法吗?像 wordpress 例如 excerpt() 或 views_embed_view() 函数的某些参数?
谢谢。
【问题讨论】:
标签:
drupal
drupal-7
drupal-views
drupal-taxonomy
【解决方案1】:
视图嵌入函数必须有两个参数:
print views_embed_view($view_name , $display_id);
地点:
您可以为上下文过滤器使用其他参数:
print views_embed_view('views_name', 'display_id', $term_id, $user_id, etc.. );
在您的情况下,不需要额外的参数。您可以继续您嵌入的内容类型的视图和显示设置设置预告片。在你的情况下:
admin/structure/types/manage/article/display/teaser
你有 field->format->body(假设有你的内容)选项 trimmed 或 summary 或 trimmed em> 在那里你可以设置你的预告片。
希望这会有所帮助。