Hello, I’ve developed a small plugin, For example this plugin process some string based on weblog entries. Plugin has some DB interaction too. Following is example code -
{if segment_3==""}
{exp:weblog:entries weblog="my_weblog" disable="member_data|pagination|trackbacks" dynamic="off"}
<h2>{title}</h2>
<div>
{exp:word_limit total="2"}
text you want processed
{/exp:word_limit}
</div>
{exp:myplugin:process entry_id="{entry_id}"}
{processed_string}
{/exp:myplugin:status}
{/exp:weblog:entries}
{/if}CASE 1: If we place this code on a template and browse that as following url - http://mydomain.com/segment_1/segment_2/ it should display data as starting conditional is TRUE.
CASE 2: and nothing should be displayed if i browse as starting conditional is FALSE. http://mydomain.com/segment_1/segment_2/segment_3
and this work for me too. But i saw it loads slow. Later i’ve enabled the template and sql debugging to see why it loads slow and saw that, the quries and tags for false conditional is processed by template parser too (For CASE 2)!
That is for url http://mydomain.com/segment_1/segment_2/segment_3, the following plugin code (myplugin and word_limit)
{exp:myplugin:process entry_id="{entry_id}"}
{processed_string}
{/exp:myplugin:status}which should not be processed by template parser as segment_3!=”“.
But if i remove my plugin code and keep word_limit plugin code(that came with EE), word_limit plugin code is not processed by template parser as segment_3!=”” and conditional is true. It seems, something is wrong in my plugin, would you help me to find out the issue.
This in EE 1.7, sorry to post here as i could not post on archived_forums.
Thanks Musa
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.