<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0" xml:base="http://mydrupalblog.lhmdesign.com">
<channel>
 <title>My Drupal Blog - Comments</title>
 <link>http://mydrupalblog.lhmdesign.com</link>
 <description>Comments</description>
 <language>en</language>
<feedburner:info uri="mydrupalblog-comments" /><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/MyDrupalBlog-Comments" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:browserFriendly>You are viewing the RSS comments feed for My Drupal Blog. If you would like more information please check out http://mydrupalblog.lhmdesign.com.</feedburner:browserFriendly><feedburner:info uri="mydrupalblog-comments" /><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/MyDrupalBlog-Comments" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:browserFriendly>You are viewing the RSS comments feed for My Drupal Blog. If you would like more information please check out http://mydrupalblog.lhmdesign.com.</feedburner:browserFriendly><feedburner:info uri="mydrupalblog-comments" /><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/MyDrupalBlog-Comments" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:browserFriendly>You are viewing the RSS comments feed for My Drupal Blog. If you would like more information please check out http://mydrupalblog.lhmdesign.com.</feedburner:browserFriendly><feedburner:info uri="mydrupalblog-comments" /><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/MyDrupalBlog-Comments" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:browserFriendly>You are viewing the RSS comments feed for My Drupal Blog. If you would like more information please check out http://mydrupalblog.lhmdesign.com.</feedburner:browserFriendly><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/MyDrupalBlog-Comments" /><feedburner:info uri="mydrupalblog-comments" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/MyDrupalBlog-Comments" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FMyDrupalBlog-Comments" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:browserFriendly>You are viewing the RSS comments feed for My Drupal Blog. If you would like more information please check out http://mydrupalblog.lhmdesign.com.</feedburner:browserFriendly><item>
 <title>Thanks for this useful</title>
 <link>http://mydrupalblog.lhmdesign.com/embed-drupal-views-using-php#comment-29078</link>
 <description>&lt;p&gt;In reply to &lt;a href="http://mydrupalblog.lhmdesign.com/embed-drupal-views-using-php"&gt;Embed Drupal Views Using PHP&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;Thanks for this useful article.&lt;/p&gt;
&lt;p&gt;One question: could you give some example of using $args (for $view-&amp;gt;preview('default', $args);)?&lt;/p&gt;
</description>
 <pubDate> <key>pubDate</key>
 <value>Wed, 11 Aug 2010 04:48:46 -0700</value>
</pubDate>
 <dc:creator> <key>dc:creator</key>
 <value>Drupal Theme Garden</value>
</dc:creator>
 <guid> <key>guid</key>
 <attributes> <isPermaLink>false</isPermaLink>
</attributes>
 <value>comment 29078 at http://mydrupalblog.lhmdesign.com</value>
</guid>
</item>
<item>
 <title>I have to agree with Guest in</title>
 <link>http://mydrupalblog.lhmdesign.com/embed-drupal-views-using-php#comment-29077</link>
 <description>&lt;p&gt;In reply to &lt;a href="http://mydrupalblog.lhmdesign.com/embed-drupal-views-using-php"&gt;Embed Drupal Views Using PHP&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;I have to agree with Guest in #3: I've definitely built sites with views that were only accessible to privileged users.&lt;/p&gt;
</description>
 <pubDate> <key>pubDate</key>
 <value>Tue, 10 Aug 2010 19:12:40 -0700</value>
</pubDate>
 <dc:creator> <key>dc:creator</key>
 <value>Brock Boland</value>
</dc:creator>
 <guid> <key>guid</key>
 <attributes> <isPermaLink>false</isPermaLink>
</attributes>
 <value>comment 29077 at http://mydrupalblog.lhmdesign.com</value>
</guid>
</item>
<item>
 <title>@ dereine
a) slightly, yes,</title>
 <link>http://mydrupalblog.lhmdesign.com/embed-drupal-views-using-php#comment-29076</link>
 <description>&lt;p&gt;In reply to &lt;a href="http://mydrupalblog.lhmdesign.com/embed-drupal-views-using-php"&gt;Embed Drupal Views Using PHP&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;@ dereine&lt;br /&gt;
a) slightly, yes, although you utilise more overall&lt;br /&gt;
b) futureproofing should be a consideration, but 'what if' arguments are always two-sided&lt;br /&gt;
c) &lt;code&gt;views_get_view(&amp;#039;VIEWNAME&amp;#039;)&lt;/code&gt; is pretty straightforward to read - would you not agree?&lt;/p&gt;
</description>
 <pubDate> <key>pubDate</key>
 <value>Tue, 10 Aug 2010 16:10:29 -0700</value>
</pubDate>
 <dc:creator> <key>dc:creator</key>
 <value>Laurence</value>
</dc:creator>
 <guid> <key>guid</key>
 <attributes> <isPermaLink>false</isPermaLink>
</attributes>
 <value>comment 29076 at http://mydrupalblog.lhmdesign.com</value>
</guid>
</item>
<item>
 <title>using an api function is</title>
 <link>http://mydrupalblog.lhmdesign.com/embed-drupal-views-using-php#comment-29075</link>
 <description>&lt;p&gt;In reply to &lt;a href="http://mydrupalblog.lhmdesign.com/embed-drupal-views-using-php"&gt;Embed Drupal Views Using PHP&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;using an api function is always the case you want.&lt;/p&gt;
&lt;p&gt;a) you have less code in your custom code.&lt;br /&gt;
b) what happens if something of the api of views changes but this function keeps his functionality&lt;br /&gt;
c) it makes easier to read the code, with views_embed_view it's sure that you want to embed a view.&lt;/p&gt;
</description>
 <pubDate> <key>pubDate</key>
 <value>Tue, 10 Aug 2010 13:56:40 -0700</value>
</pubDate>
 <dc:creator> <key>dc:creator</key>
 <value>dereine</value>
</dc:creator>
 <guid> <key>guid</key>
 <attributes> <isPermaLink>false</isPermaLink>
</attributes>
 <value>comment 29075 at http://mydrupalblog.lhmdesign.com</value>
</guid>
</item>
<item>
 <title>@ Guest
'right' is subjective</title>
 <link>http://mydrupalblog.lhmdesign.com/embed-drupal-views-using-php#comment-29074</link>
 <description>&lt;p&gt;In reply to &lt;a href="http://mydrupalblog.lhmdesign.com/embed-drupal-views-using-php"&gt;Embed Drupal Views Using PHP&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;@ Guest&lt;br /&gt;
'right' is subjective - I'd think access checking for views is rarely necessary, and if it were the original code could be extended:&lt;/p&gt;
&lt;p&gt;&lt;div class="codeblock"&gt;&lt;code&gt;&lt;span style="color: #000000"&gt;&lt;span style="color: #0000BB"&gt;&amp;lt;?php&lt;br /&gt;$view &lt;/span&gt;&lt;span style="color: #007700"&gt;= &lt;/span&gt;&lt;span style="color: #0000BB"&gt;views_get_view&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'VIEWNAME'&lt;/span&gt;&lt;span style="color: #007700"&gt;);&lt;br /&gt;if (&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$view&lt;/span&gt;&lt;span style="color: #007700"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;access&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'default'&lt;/span&gt;&lt;span style="color: #007700"&gt;)) {&lt;br /&gt;&amp;nbsp; print &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$view&lt;/span&gt;&lt;span style="color: #007700"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;preview&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'default'&lt;/span&gt;&lt;span style="color: #007700"&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
</description>
 <pubDate> <key>pubDate</key>
 <value>Tue, 10 Aug 2010 09:38:40 -0700</value>
</pubDate>
 <dc:creator> <key>dc:creator</key>
 <value>Laurence</value>
</dc:creator>
 <guid> <key>guid</key>
 <attributes> <isPermaLink>false</isPermaLink>
</attributes>
 <value>comment 29074 at http://mydrupalblog.lhmdesign.com</value>
</guid>
</item>
<item>
 <title>views_embed_view() is the</title>
 <link>http://mydrupalblog.lhmdesign.com/embed-drupal-views-using-php#comment-29073</link>
 <description>&lt;p&gt;In reply to &lt;a href="http://mydrupalblog.lhmdesign.com/embed-drupal-views-using-php"&gt;Embed Drupal Views Using PHP&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;views_embed_view() is the right way to do it. It's the primary public API function that includes things like access checking.&lt;/p&gt;
</description>
 <pubDate> <key>pubDate</key>
 <value>Tue, 10 Aug 2010 08:50:57 -0700</value>
</pubDate>
 <dc:creator> <key>dc:creator</key>
 <value>Guest</value>
</dc:creator>
 <guid> <key>guid</key>
 <attributes> <isPermaLink>false</isPermaLink>
</attributes>
 <value>comment 29073 at http://mydrupalblog.lhmdesign.com</value>
</guid>
</item>
<item>
 <title>@ dixon_
whilst there is</title>
 <link>http://mydrupalblog.lhmdesign.com/embed-drupal-views-using-php#comment-29072</link>
 <description>&lt;p&gt;In reply to &lt;a href="http://mydrupalblog.lhmdesign.com/embed-drupal-views-using-php"&gt;Embed Drupal Views Using PHP&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;@ dixon_&lt;br /&gt;
whilst there is slightly less initial written code in your example, the &lt;code&gt;views_embed_view()&lt;/code&gt; function (from Views 'views.module' file) basically contains the code I have outlined:&lt;/p&gt;
&lt;p&gt;&lt;div class="codeblock"&gt;&lt;code&gt;&lt;span style="color: #000000"&gt;&lt;span style="color: #0000BB"&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #007700"&gt;function &lt;/span&gt;&lt;span style="color: #0000BB"&gt;views_embed_view&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$name&lt;/span&gt;&lt;span style="color: #007700"&gt;, &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$display_id &lt;/span&gt;&lt;span style="color: #007700"&gt;= &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'default'&lt;/span&gt;&lt;span style="color: #007700"&gt;) {&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$args &lt;/span&gt;&lt;span style="color: #007700"&gt;= &lt;/span&gt;&lt;span style="color: #0000BB"&gt;func_get_args&lt;/span&gt;&lt;span style="color: #007700"&gt;();&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;array_shift&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$args&lt;/span&gt;&lt;span style="color: #007700"&gt;); &lt;/span&gt;&lt;span style="color: #FF8000"&gt;// remove $name&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #007700"&gt;if (&lt;/span&gt;&lt;span style="color: #0000BB"&gt;count&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$args&lt;/span&gt;&lt;span style="color: #007700"&gt;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;array_shift&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$args&lt;/span&gt;&lt;span style="color: #007700"&gt;); &lt;/span&gt;&lt;span style="color: #FF8000"&gt;// remove $display_id&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #007700"&gt;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$view &lt;/span&gt;&lt;span style="color: #007700"&gt;= &lt;/span&gt;&lt;span style="color: #0000BB"&gt;views_get_view&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$name&lt;/span&gt;&lt;span style="color: #007700"&gt;);&lt;br /&gt;&amp;nbsp; if (!&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$view &lt;/span&gt;&lt;span style="color: #007700"&gt;|| !&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$view&lt;/span&gt;&lt;span style="color: #007700"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;access&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$display_id&lt;/span&gt;&lt;span style="color: #007700"&gt;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; return &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$view&lt;/span&gt;&lt;span style="color: #007700"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;preview&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$display_id&lt;/span&gt;&lt;span style="color: #007700"&gt;, &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$args&lt;/span&gt;&lt;span style="color: #007700"&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;which, overall, results in &lt;code&gt;views_embed_view()&lt;/code&gt; utilising more code not less.&lt;/p&gt;
</description>
 <pubDate> <key>pubDate</key>
 <value>Tue, 10 Aug 2010 07:55:07 -0700</value>
</pubDate>
 <dc:creator> <key>dc:creator</key>
 <value>Laurence</value>
</dc:creator>
 <guid> <key>guid</key>
 <attributes> <isPermaLink>false</isPermaLink>
</attributes>
 <value>comment 29072 at http://mydrupalblog.lhmdesign.com</value>
</guid>
</item>
<item>
 <title>Or you could use this</title>
 <link>http://mydrupalblog.lhmdesign.com/embed-drupal-views-using-php#comment-29071</link>
 <description>&lt;p&gt;In reply to &lt;a href="http://mydrupalblog.lhmdesign.com/embed-drupal-views-using-php"&gt;Embed Drupal Views Using PHP&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;Or you could use this approach which more or less does what you are doing, but with less code ;)&lt;/p&gt;
&lt;p&gt;&lt;div class="codeblock"&gt;&lt;code&gt;&lt;span style="color: #000000"&gt;&lt;span style="color: #0000BB"&gt;&amp;lt;?php&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #007700"&gt;print &lt;/span&gt;&lt;span style="color: #0000BB"&gt;views_embed_view&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'my_view'&lt;/span&gt;&lt;span style="color: #007700"&gt;, &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'block_1'&lt;/span&gt;&lt;span style="color: #007700"&gt;, &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$arg1&lt;/span&gt;&lt;span style="color: #007700"&gt;, &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$arg2&lt;/span&gt;&lt;span style="color: #007700"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
</description>
 <pubDate> <key>pubDate</key>
 <value>Tue, 10 Aug 2010 07:18:50 -0700</value>
</pubDate>
 <dc:creator> <key>dc:creator</key>
 <value>dixon_</value>
</dc:creator>
 <guid> <key>guid</key>
 <attributes> <isPermaLink>false</isPermaLink>
</attributes>
 <value>comment 29071 at http://mydrupalblog.lhmdesign.com</value>
</guid>
</item>
<item>
 <title>Too right.</title>
 <link>http://mydrupalblog.lhmdesign.com/kontera-removed#comment-29070</link>
 <description>&lt;p&gt;In reply to &lt;a href="http://mydrupalblog.lhmdesign.com/kontera-removed"&gt;Kontera Removed&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;Too right.&lt;/p&gt;
</description>
 <pubDate> <key>pubDate</key>
 <value>Sun, 08 Aug 2010 11:44:43 -0700</value>
</pubDate>
 <dc:creator> <key>dc:creator</key>
 <value>Guest</value>
</dc:creator>
 <guid> <key>guid</key>
 <attributes> <isPermaLink>false</isPermaLink>
</attributes>
 <value>comment 29070 at http://mydrupalblog.lhmdesign.com</value>
</guid>
</item>
<item>
 <title>Nice site, very informative.</title>
 <link>http://mydrupalblog.lhmdesign.com/drupal-5-1-png-ie6#comment-29069</link>
 <description>&lt;p&gt;In reply to &lt;a href="http://mydrupalblog.lhmdesign.com/drupal-5-1-png-ie6"&gt;Drupal 5.1 + PNG + IE6&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;Nice site, very informative. Thanks for sharing.&lt;/p&gt;
</description>
 <pubDate> <key>pubDate</key>
 <value>Sat, 07 Aug 2010 10:22:15 -0700</value>
</pubDate>
 <dc:creator> <key>dc:creator</key>
 <value>Rechnung schreiben</value>
</dc:creator>
 <guid> <key>guid</key>
 <attributes> <isPermaLink>false</isPermaLink>
</attributes>
 <value>comment 29069 at http://mydrupalblog.lhmdesign.com</value>
</guid>
</item>
</channel>
</rss>
