Blog on Web Design, SEO, Marketing Optimization, Web Development, and Random Stuff by Mike Wagan
Saturday, January 29, 2011
15 Sites Web Developers and Designers Should Know
Creating a good website isn’t an easy task, but there’s a few tools that can definitely make your developer or designer life easier. In this article, I have compiled 15 extremely useful website that any web developer or web designer should have bookmarked.
Monday, January 17, 2011
Drupal 6: Embedding a View in a Template using views_embed_view
If you need to embed a view inside a template or a node if the input type is PHP code, there is a very simple function called views_embed_view() which will allow you to do so very easily.
I posted another method of doing this before here but this one is much simpler. The views_embed_view has 2 default arguments. The second argument allows you to enter the display_id of the view (example: default, page, block, etc). Any additional argument you specify will be passed to the views argument handler. For instance, if you wanted to embed the block view and pass it a list of nodeIDs as an argument:
Source: http://thedrupalblog.com/embedding-view-drupal-6-using-views-embed-view
I posted another method of doing this before here but this one is much simpler. The views_embed_view has 2 default arguments. The second argument allows you to enter the display_id of the view (example: default, page, block, etc). Any additional argument you specify will be passed to the views argument handler. For instance, if you wanted to embed the block view and pass it a list of nodeIDs as an argument:
<?php
$viewName = 'MYVIEWNAME';
$display_id = 'block';
$myNodes = array(1, 2, 3);
print views_embed_view($viewName, $display_id, $myNodes);
?>
Source: http://thedrupalblog.com/embedding-view-drupal-6-using-views-embed-view
Subscribe to:
Posts (Atom)