Koozali.org: home of the SME Server

Legacy Forums => Experienced User Forum => Topic started by: mrjhb3 on February 15, 2004, 06:37:17 AM

Title: Templating fragments that contain php code
Post by: mrjhb3 on February 15, 2004, 06:37:17 AM
Hello,

I am attempting to create a custom template of a module that is using php code.  When I do a
/sbin/e-smith/expand-template /path to my fragments, I get the following error:

[root@bottom60 index.php3]# /sbin/e-smith/expand-template /opt/administration/jbtest/index.php3
ERROR: Cannot process template /etc/e-smith/templates-custom//opt/administration/jbtest/index.php3/01begin: No such file or directory
 at /sbin/e-smith/expand-template line 49

This 01begin contains some php code in it.  If I remove this fragment and a 99end fragment that contains some php code as well, then the other fragments will work.  But, I need the php code that goes before and after these fragments in order for the code to work.  The expand-template is trying to execute some of the code in the php fragmented file.  I don't want this.  So, my question is, how can I get the expand-template event to just place the php code into the index.php3 file without trying to execute any of the code in that or other particular fragments?

TIA for all help.
Title: Templating fragments that contain php code
Post by: grand-pa on February 15, 2004, 05:35:55 PM
Everything between accolades {} is considered and interpreted as PERL code by expand-templates. I think you can escape all these accolades (I never tried but it may work).
Title: Templating fragments that contain php code
Post by: tape on February 15, 2004, 06:25:11 PM
Quote from: "grand-pa"
Everything between accolades {} is considered and interpreted as PERL code by expand-templates. I think you can escape all these accolades (I never tried but it may work).


i have never tried... but if he just to put out the lines using  perl/bash print or echo it should work in this case...

hth
Anton
Title: Templating fragments that contain php code
Post by: mrjhb3 on February 16, 2004, 12:16:32 AM
Yes, the above will work, I was just hoping/looking for an easier way.  I'll work with it and see how/if I can get it to work with minimal effort.

Thanks,

JB