Koozali.org: home of the SME Server

Templating fragments that contain php code

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
Templating fragments that contain php code
« 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.
......

Offline grand-pa

  • *
  • 190
  • +0/-0
    • SME Server Fr
Templating fragments that contain php code
« Reply #1 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).
SME Server v7.4 Server and gateway
Shuttle K45, Celeron E1400, 2x1Go DDR2, 2x250 Go SATA2 RAID-1

tape

Templating fragments that contain php code
« Reply #2 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

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
Templating fragments that contain php code
« Reply #3 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
......