Author Topic: [special:strings] and {{!name}}  (Read 1603 times)

0 Members and 1 Guest are viewing this topic.

Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1890
    • View Profile
[special:strings] and {{!name}}
« on: December 16, 2007, 12:16:49 AM »
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

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: [special:strings] and {{!name}}
« Reply #1 on: December 16, 2007, 04:35:39 PM »
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.

Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1890
    • View Profile
Re: [special:strings] and {{!name}}
« Reply #2 on: December 16, 2007, 06: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?

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: [special:strings] and {{!name}}
« Reply #3 on: December 16, 2007, 06: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