Help programming User Defined Tag to call Smarty Function {mailto}
Posted: Tue Dec 05, 2006 4:52 am
I am not a proficient PHP coder (in fact less than a hack), but I need help to accomplish this:
Within a template I have set a hidden content block to capture an email address in the Page Editor, then pass it to the {mailto} Smarty, thus:
All well and good except that if the "email" block is empty, then I get an error, so I am wondering how to correctly code either the template or call some script in a User Defined Tag to only call the Smarty {mailto} if the $email1 isn't empty?
I thought of doing something this:
But I don't know my PHP or smarty well enough to know how to form the {mailto} call within a PHP script - if it can be done.
Any help on this? Thank you. I am learning gobs but this one I have hit the wall of my own grasp of PHP syntax.
Wayne
Within a template I have set a hidden content block to capture an email address in the Page Editor, then pass it to the {mailto} Smarty, thus:
Code: Select all
<div id="hidden">{content block="email" oneline='true' wysiwyg='false' assign=email1}</div>
{mailto address=$email1 encode='hex'}
I thought of doing something this:
Code: Select all
if ( isset($params['email1']) && !empty($params['email1'])) {
then execute a {mailto ...};
}
Any help on this? Thank you. I am learning gobs but this one I have hit the wall of my own grasp of PHP syntax.
Wayne