Forums / Developer / php in template

php in template

Author Message

Henrik Heiestad

Friday 02 December 2005 12:37:06 pm

Hi,

to be able to include php code in my templates, I have implemented "marksPHPinsert" function (http://ez.no/products/ez_publish_cms/documentation/customization/tips_tricks/including_php_files_in_templates).

marksPHPinsert works very fine, and makes me include my scripts using this command {"http://www.mydomain.com/myfile.php"|marksPHPinsert}

I have developed a php-application that I want to include to one of my templates. But this application needs som arguments from the template to work (like http://www.mydomain.com/myfile.php?id=1234). Is it possible to alter this command to take arguments?

Like: {"http://www.mydomain.com/myfile.php?id=$node.node_id"|marksPHPinsert} (this does not work).

Best regards.
Henrik

Gabriel Ambuehl

Friday 02 December 2005 12:40:55 pm

You should use concat, variable expansion inside strings isn't supported.

So something like
concat("http://www.mydomain.com/myfile.php?id=",$yourvariableargument)|someoperator
should work.

Visit http://triligon.org

Henrik Heiestad

Friday 02 December 2005 1:20:34 pm

Thanks Gabriel,

that concat worked perfectly.

Best regards.