简体   繁体   English

Drupal:查看标题

[英]Drupal: Views titles

I have a View that outputs a page. 我有一个输出页面的视图。 Under Basic Settings I set a "title". 在“基本设置”下,我设置了“标题”。 When I load the page, I see that title as the page title (at top of the browser) - all good. 加载页面时,我看到该标题作为页面标题(在浏览器顶部)-一切都很好。

How can I print this value out in the "Display output" .tpl file? 如何在“显示输出” .tpl文件中打印该值? The $title variable doesn't seem to hold any value here. $ title变量在这里似乎没有任何值。 Do I need to use a preprocess function? 我需要使用预处理功能吗?

Thanks 谢谢

drupal_get_title()是否起作用?

You can get the details of the full view using 您可以使用获取完整视图的详细信息

You can get the title of all the displays there 您可以在那里获取所有显示的标题

$view2=views_get_current_view();
$view2->display['default']->display_options['title'];

If you just want to print the title than no need to write the .tpl file. 如果您只想打印标题,则无需编写.tpl文件。

In views you will find header region and there you can add the global text are and by using it , you can add the title text over there. 在视图中,您将找到标题区域,然后可以在其中添加全局文本,通过使用它,您可以在此处添加标题文本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM