calling tags in a module

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
nafise

calling tags in a module

Post 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\"}
mahjong

Re: calling tags in a module

Post by mahjong »

Code: Select all

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

Re: calling tags in a module

Post by nafise »

but contact_form is a tag, not a module!!
nafise

Re: calling tags in a module

Post 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 :).
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: calling tags in a module

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Locked

Return to “CMSMS Core”