Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

How to include Smarty variable into path to file

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-02-2008, 03:01 PM
  HumanNature's Avatar 
HumanNature HumanNature is offline
 

Member
  
Join Date: Aug 2006
Posts: 26
 

Default How to include Smarty variable into path to file

Dear friends,

I have a custom smarty variable in my '$page_data' array called '$page_data.pagemenu'

The value of '$page_data.pagemenu' is the text 'pagemenu.tpl'.

If I write the following in my templates {$page_data.pagemenu} I obtain the text 'pagemenu.tpl' written, which is OK.

The problem is that I need to use '$page_data.pagemenu' to include a file this way:

{include file="path/to/{$page_data.pagemenu}" }

Doing this I try to include the following file:

{include file="path/to/pagemenu.tpl"}

I don╢t Know why but I allways obtain an smarty error and I have tried a lot of different sintaxes with no luck.

Can you please help me?
__________________
X-Cart 4.1.5
PHP 4.3.9
Mysql 4.1
VPS CentOS 4.2
Mods: Too much...
* Moving to 4.1.8 and to a dedicated server *
Reply With Quote
  #2  
Old 01-02-2008, 04:24 PM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default Re: How to include Smarty variable into path to file

use back quotes to evaluate like in unix/linux ('':literal, "":expression, ``:evaluate)

ie:
{include file="path/to/`$page_data.pagemenu`" }
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:16 PM.

   

 
X-Cart forums © 2001-2020