rejetto forum

[special:strings] and {{!name}}

Mars · 4 · 1958

0 Members and 1 Guest are viewing this topic.

Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2039
    • View Profile
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: 13309
    • View Profile
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: 2039
    • View Profile
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: 13309
    • View Profile