Drupal 6: Render Views 2 data in a page tpl file

喜你入骨 提交于 2020-01-05 05:47:11

问题


I think the answer might be obvious but I can't seem to figure it out.

How do I render a view I've created in Views 2 (Drupal) in a page-pagename.tpl.file? My thought was that it would be some sort of PHP snippet but I can't find documentation about it.

Any thoughts that might steer me in the right direction.


回答1:


The solution is here:

http://views-help.doc.logrus.com/help/views/embed

Also "function" can be replaced with "print" and the additional param brackets can be removed.

So it will look like this:

$name = "yourviewnamegoeshere";
print views_embed_view($name, $display_id = 'default');



来源:https://stackoverflow.com/questions/1543964/drupal-6-render-views-2-data-in-a-page-tpl-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!