Page 1 of 1

calling tags in a module

Posted: Sun Jul 02, 2006 11:41 am
by nafise
hi
i just start writing a test module to see how can i write a module and ....
now i have a question, is there any way to put a tag in the module code?for example if i want something like feedback form, with different emails how can i put something like this in the module code?

Code: Select all

{contact_form email=\"$email\"}

Re: calling tags in a module

Posted: Sun Jul 02, 2006 1:54 pm
by mahjong

Code: Select all

{cms_module module="contact_form" email=$email}

Re: calling tags in a module

Posted: Mon Jul 03, 2006 5:30 am
by nafise
but contact_form is a tag, not a module!!

Re: calling tags in a module

Posted: Mon Jul 03, 2006 8:11 am
by nafise
i finally find it:
i replace this part

Code: Select all

$this->smarty->assign('mail',"{contact_form email=".$email."}" );

echo $this->ProcessTemplate('mail.tpl');
with this:

Code: Select all

$this->smarty->assign('mail',"{contact_form email=".$email."}" );

$tempdata = $this->ProcessTemplate('mail.tpl');
echo $this->ProcessTemplateFromData($tempdata);
and mail.tpl is like this :

Code: Select all

<table align="center" border="0" width="100%" dir="rtl" style="font-family:tahoma;">
    <tr>
        <td align="right" colspan="3">
            {$mail}
        </td>
    </tr>
</table>
hope to help someone :).

Re: calling tags in a module

Posted: Thu Aug 17, 2006 2:01 am
by calguy1000
ooh, this is very cool.... could you please post an entry somewhere in the developers section of the wiki (maybe create a new Tricks & Tips page) about exactly how to do this.

I'm sure others would like to have a convenient place to find this information.

Thank you.