开发者

using views argument in the view tpl.php file

i am a newby to drupal. here is my problem: on my main page.tpl.php i have this code lines:

"if ( $is_front == TRUE ) {

print views_embed_view('all_product_by_type_thin', "default", "canon");

print views_embed_view('all_product_by_type_thin', "default", "Nikon");

}"

as you can see开发者_如何学Python, in case of the front page i print the "all_product_by_type_thin" view while sending parameter "cannon" and "nikon"

the result of the all_product_by_type_thin view is altered inside the views-view-unformatted--all_product_by_type_thin.tpl.php file. in that file i am wrapping the view results in all kind of divs. what i need to do though, and cant figure out a way to do it, is get the argument i sent the view "canon" or "nikon" inside the php code of views-view-unformatted--all_product_by_type_thin.tpl.php any idea ?


Inside your Views theme file ie. views-view-unformatted--all_product_by_type_thin.tpl.php you should have access to the $view object.

One of the attributes of this object will contain the arguments passed to the view. You can do a print_r and find this attribute and hence, the arguments.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜