Hi<br>I think the problem here is not in {dynamic} or in {include}, I think the plugin object doesn&#39;t reach to the template because it&#39;s cached so if you can assign plugin object to smarty before you check if the page is cached it will work.
<br><br>regards,<br>&nbsp;&nbsp;&nbsp; Ahmad<br><br><div><span class="gmail_quote">On 5/3/07, <b class="gmail_sendername">Jon Daley</b> &lt;<a href="mailto:plogworld@jon.limedaley.com">plogworld@jon.limedaley.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Yes, I agree, except that the plugins like blogstatistics,<br>authentication and google haven&#39;t worked since we added the template<br>cache, so we did lose useful functionality.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Authentication has now been implemented in the core, but I like
<br>both the blogstatistics and google plugins, and wish there was a way to<br>make it work.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Using the {insert} tag would be an acceptable solution to me, and<br>it might be possible to get that to work both to optimize the load for
<br>cached pages, and only incur the overhead was processing the extra<br>inserted templates.<br><br><br>On Wed, 2 May 2007, Oscar Renalias wrote:<br><br>&gt; Well yeah it&#39;s not that getting plugins to run within cached pages
<br>&gt; was technically impossible... With a little bit of code here and<br>&gt; there everything&#39;s possible :) But we never really had a need to get<br>&gt; plugins to run in a cached pages, or else we&#39;re kind of defeating the
<br>&gt; point of caching. If there&#39;s something that we&#39;re not able to cache,<br>&gt; we&#39;re still incurring in some extra overhead, as Smarty needs to<br>&gt; process and render a small bit of a template.<br>&gt;
<br>&gt; We can of course make the changes to get around this limitation but I<br>&gt; see two issues:<br>&gt;<br>&gt; 1) we wouldn&#39;t be able to do it before 1.3, because we shouldn&#39;t<br>&gt; break/change the standard behaviour of plugins and the whole plugin
<br>&gt; framework this late into the 1.2.x branch.<br>&gt;<br>&gt; 2) and most important, I have been thinking about ways to optimize<br>&gt; cached pages even more. Right now we still need to load the whole<br>&gt; framework in order to display a page that has already been generated
<br>&gt; and for which we don&#39;t need any extra classes or processing: we just<br>&gt; need to load the cached version from disk and push it to the client.<br>&gt; Ideally all we would need to do is come up with a way to quickly
<br>&gt; identify if a page is cached (maybe we can use a hash of the URL?)<br>&gt; and quickly send it back to the client, but I need to have a closer<br>&gt; look at the code and see if this is even feasible to do...<br>
&gt;<br>&gt; Number 2 obviously means that plugins wouldn&#39;t work in cached pages<br>&gt; and this time there wouldn&#39;t even a workaround available.<br>&gt;<br>&gt; On 2 May 2007, at 17:26, Jon Daley wrote:<br>&gt;<br>
&gt;&gt; <a href="http://bugs.lifetype.net/view.php?id=293">http://bugs.lifetype.net/view.php?id=293</a><br>&gt;&gt;<br>&gt;&gt; We have talked about this a long time ago, and came up with the<br>&gt;&gt; conclusion<br>&gt;&gt; that plugins can&#39;t work inside the {dynamic} tag. It turns out that
<br>&gt;&gt; isn&#39;t<br>&gt;&gt; really true.<br>&gt;&gt;<br>&gt;&gt; The problem is in class/view/blogview.class.php, where a bunch of<br>&gt;&gt; template<br>&gt;&gt; objects are only included if the template isn&#39;t cached.&nbsp;&nbsp;If you
<br>&gt;&gt; move the<br>&gt;&gt; plugin for loop (or the $now) code, those variables are available<br>&gt;&gt; inside a<br>&gt;&gt; {dynamic} tag.<br>&gt;&gt;<br>&gt;&gt; However, since that increases the RAM used for cached pages, we
<br>&gt;&gt; don&#39;t want<br>&gt;&gt; to just put everything outside the if(!cached) block.<br>&gt;&gt;<br>&gt;&gt; I was wondering about either letting the plugins decide themselves<br>&gt;&gt; if they<br>&gt;&gt; should be loaded or not, or check the template to see if there is a
<br>&gt;&gt; {dynamic} tag or have an administration preference that says &quot;Allow<br>&gt;&gt; plugins inside dynamic tags.&nbsp;&nbsp;I am not sure what would be the<br>&gt;&gt; easiest or<br>&gt;&gt; best.&nbsp;&nbsp;Any thoughts?<br>&gt;&gt;
<br>&gt;&gt; I see now that for the plugins the objects are already loaded even<br>&gt;&gt; in a<br>&gt;&gt; cached view (I think) but the call to PluginManager-&gt;getPlugins calls<br>&gt;&gt; register() for each plugin in the non-cached view as opposed to the
<br>&gt;&gt; cached<br>&gt;&gt; view.&nbsp;&nbsp;Maybe that overhead isn&#39;t that much?<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; _______________________________________________<br>&gt;&gt; pLog-svn mailing list<br>&gt;&gt; <a href="mailto:pLog-svn@devel.lifetype.net">
pLog-svn@devel.lifetype.net</a><br>&gt;&gt; <a href="http://limedaley.com/mailman/listinfo/plog-svn">http://limedaley.com/mailman/listinfo/plog-svn</a><br>&gt;&gt;<br>&gt;<br>&gt; _______________________________________________
<br>&gt; pLog-svn mailing list<br>&gt; <a href="mailto:pLog-svn@devel.lifetype.net">pLog-svn@devel.lifetype.net</a><br>&gt; <a href="http://limedaley.com/mailman/listinfo/plog-svn">http://limedaley.com/mailman/listinfo/plog-svn
</a><br>&gt;<br><br>--<br>Jon Daley<br><a href="http://jon.limedaley.com/">http://jon.limedaley.com/</a><br><br>If animals weren&#39;t created to be eaten,<br>&nbsp;&nbsp; why are they made out of meat?!<br>_______________________________________________
<br>pLog-svn mailing list<br><a href="mailto:pLog-svn@devel.lifetype.net">pLog-svn@devel.lifetype.net</a><br><a href="http://limedaley.com/mailman/listinfo/plog-svn">http://limedaley.com/mailman/listinfo/plog-svn</a><br></blockquote>
</div><br>