rejetto forum
May 25, 2012, 02:06:49 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [special:strings] and {{!name}}  (Read 1221 times)
0 Members and 2 Guests are viewing this topic.
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1481



View Profile WWW
« on: December 15, 2007, 06:16:49 PM »

Quote
{{!user}}

[special:strings]
user=Logged User

work correctly

Quote
{{!user}}

[special:strings]
{{load|/strings.txt}}

strings.txt:
user=Logged User
EOF

{{!user}} seems to be estimated before the load of the external file {{load|strings.txt}} containing the corresponding value  'user=Logged User'
While the same load placed in the part body of the main page works correctly
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11829


View Profile
« Reply #1 on: December 16, 2007, 10:35:39 AM »

macros are executed when needed.
when the tpl is loaded, no macro is executed.
[special:strings] is expected to be a table, and no macro is called when hfs accesses it.
Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1481



View Profile WWW
« Reply #2 on: December 16, 2007, 12:10:56 PM »

somewhere, when a tpl is loaded all %symbol%  are replaced in template, we can considere that {{!name}} ask information from special section or it will be possible to extend the macro  {{!name}} in an external file or text like

{{!name|url%lang%.txt}} 

not necessary to write

Quote
[special:string]

{{switch|%lang%
|fr|{{load|/languages/fr.lng}}
|..|.....................................
|en|{{load|/languages/en.lng}}
}}

[/specail]

no {{load}} is needed  and only what you want is loaded  from the external file
file


example 
if name exits in to [special:string] and not in the external file then  {{!name|url%lang%.txt}}  works as {{!name}}

QUESTION : I d'ont see if {{!name}} is  case sensitive?
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11829


View Profile
« Reply #3 on: December 16, 2007, 12:21:46 PM »

it is not sensitive AFAIK

in the while i created this solution (much more generic)
www.rejetto.com/forum/?topic=5349.msg1031223#msg1031223
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page May 10, 2012, 02:52:13 AM
anything