Page 1 of 1

Smarty

Posted: Thu Oct 14, 2004 3:11 pm
by Thijs
Since CMS generated pages are based on Smarty, you have access to a lot of powerful features that smarty offers.

Let us look at the mailto custom function. The following code

Code: Select all

{mailto address="me@domain.com"}
{mailto address="me@domain.com" text="send me some mail"}
{mailto address="me@domain.com" encode="javascript"}
{mailto address="me@domain.com" encode="hex"}
{mailto address="me@domain.com" subject="Hello to you!"}
{mailto address="me@domain.com" cc="you@domain.com,they@domain.com"}
{mailto address="me@domain.com" extra='class="email"'}
is translated to:

Code: Select all

<a href="mailto:me@domain.com" >me@domain.com</a>
<a href="mailto:me@domain.com" >send me some mail</a>
<__script__ type="text/javascript" language="javascript">eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%6
9%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d%
61%69%6e%2e%63%6f%6d%22%20%3e%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%3c%2f%61%3e
%27%29%3b'))</__script>
<a href="mailto:%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d" >me@domain.com</a>
<a href="mailto:me@domain.com?subject=Hello%20to%20you%21" >me@domain.com</a>
<a href="mailto:me@domain.com?cc=you@domain.com%2Cthey@domain.com" >me@domain.com</a>
<a href="mailto:me@domain.com" class="email">me@domain.com</a>
Easy as that. Especially the javascript based encoding is an effective anti-spam measure.

Re: Smarty

Posted: Tue Apr 12, 2005 10:29 pm
by kishman155
Thanks for this i will play with it a while

mfg
Kris

Re: Smarty

Posted: Thu Jul 23, 2009 8:56 pm
by uhuy.net
thanks,
i just looking for this