简体   繁体   English

具有视图标题的Drupal块

[英]Drupal Block with View Titles

In Drupal7 I have a block showing the title of a view: 在Drupal7中,我有一块显示视图标题的块:

$view = views_get_view('view_name');
print $view->human_name;

Now I want to do this for all views shown in the content area of the page. 现在,我想对页面内容区域中显示的所有视图执行此操作。 I have tried several things but no clue how to make it, as I'm not familiar with php. 我已经尝试了几件事,但是不知道如何实现,因为我对php不熟悉。

Any help is appreciated! 任何帮助表示赞赏!

If I understand your question, you're trying to output the title of the current page view. 如果我理解您的问题,则您正在尝试输出当前页面视图的标题。 If that's the case, try this: 如果是这种情况,请尝试以下操作:

$view = views_get_page_view();
print $view->human_name;

See https://api.drupal.org/api/views/views.module/function/views_get_page_view/7 参见https://api.drupal.org/api/views/views.module/function/views_get_page_view/7

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

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