Should I use Prefilter or Plugin for "advanced" popups?
| From: | Tommy Ipsen | Date: | Fri, 23 Apr 2004 22:00:30 +0000 |
| Subject: | Should I use Prefilter or Plugin for "advanced" popups? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-11301@lists.php.net to get a copy of this message | ||
Hi Smarty experts!
I need to use popups (I know they're evil) for context dependent help in a CMS system I'm developing. For (almost) the same purpose I'm also using the popup function from Smarty to create instant tips or explanations for different items.
I'm using templates for the different administration pages and would like to combine the use of popup as well as creating "real" popup-links using the least possible amount of data.
I thought the following would suffice for the templates:
{TI_Help_popup helpid="helpitemidentifier" header="caption" helptext="This is a short message!"}
And it should generate this code:
<a href="/admin/helppopup.php?id=helpid" target="ticmshelp" onclick="link_popup(this);return false" {popup delay=300 caption="caption" text="This is a short message!"}><img class="helpicon" src="/admin/images/icon_help.gif" alt="" /></a>
Which in turn should generate the following html:
<a href="/admin/helppopup.php?id=helpid" target="ticmshelp" onclick="link_popup(this);return false" onmouseover="return overlib('This is a short message!',DELAY,'300',CAPTION,'caption');" onmouseout="nd();"><img class="helpicon" src="/admin/images/icon_help.gif" alt="" /></a>
The above is written "thinking in prefiltering" but the essence is that I want to write the really short version in the template and the output should be the html code written above! I can't really figure out if prefiltering is the way to or if I somehow need to modify the popup function within Smarty!?
Hope you can help me out here... - thanks in advance!
Cheers, Tommy Ipsen