Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

html_select_date and config_load

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
machalla
Smarty Rookie


Joined: 13 Jan 2006
Posts: 6

PostPosted: Tue Aug 15, 2006 12:54 pm    Post subject: html_select_date and config_load Reply with quote

Hi,

I was wondering if anyone has an answer for this one. I can't seem to find it so far.

I am using a html_select_date in a template. I also use a config file to set the titles for the template. I want to set the title for my html_select_date but it causes an error when I attempt to use the usual syntax as it is already within the braces {}. I have placed the call to title within the all_extra option for html_select_date. If I don't use braces then it just uses the variable name instead of its actual value.

This version will just use #start_title# as the title

{html_select_date prefix="start" end_year=+5 field_order='DMY' month_format='%m'} Time {html_select_time time=$setTime+5*60 use_24_hours=true prefix="start" display_seconds=false all_extra="title='#start_title#'"}


This version causes the below error (I would assume it is because you cannot use {} inside {}.

{html_select_date prefix="start" end_year=+5 field_order='DMY' month_format='%m'} Time {html_select_time time=$setTime+5*60 use_24_hours=true prefix="start" display_seconds=false all_extra="title='{#start_title#}'"}

syntax error: invalid attribute name: '=' (Smarty_Compiler.class.php, line 1533) in /var/lib/php/smarty/Smarty.class.php on line 1095

I'm not even sure its possible to do this but if anyone can suggest a way that would be really helpful.

Thanks.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Tue Aug 15, 2006 1:38 pm    Post subject: Reply with quote

try this:

all_extra="title='`$smarty.config.start_title`'"
Back to top
View user's profile Send private message Visit poster's website
machalla
Smarty Rookie


Joined: 13 Jan 2006
Posts: 6

PostPosted: Tue Aug 15, 2006 1:53 pm    Post subject: Reply with quote

That worked perfectly. Thanks very much for the help mohrt.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP