1
snow77
Smarty usage from any .html template
  • 2008/8/8 3:26

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


XOOPS templates have a great usage of smarty.

What is the technical reason that smarty tags will only work from certain files and not others?

For example:

<{$block.lang_username}>
does not work from theme.html

or

why won't xoImgUrl or xoops_slogan display in the site-redirect and site_closed templates.

Same happens with lots of other smarty.

As I don't know much of the usage of smarty, my question is: Why does smarty tags functions display from certain files and not others.

Can't there be a file in the system that reads all the available smarty tags available in the whole core and modules and installed and make them execute from any other template available?

I've seen how Kris_fr has done hacking a core file, making smarties available to the theme.html. That is a solution.

But can't there be another way that all of the smarty tags found in your XOOPS (core + modules), can be read from any .html template? ...from a simple file that says something like: find all smarty and include them in functions.php (if that is the file that makes the executing of smarty from any .html template file)?

Or is smarty in fact just limited to be applied to certain files?

2
ghia
Re: Smarty usage from any .html template
  • 2008/8/8 10:47

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Smarty get the information (apart from some general memory var's) from arrays that the programs assemble with information especially for their purpose. Only the information directly needed is compiled in.
The tags have no other purpose then to have a smart way of filling in HTML layout blocks. So the programming and information gets separated from design and appearance.
It would be possible to accumulate more information in the blocks and sometimes there is also need or advantage to have one more information item for a particular block or template.
But having always all possible information ready would be very inefficient: All data have to be processed and retrieved from the database, which cost also power and time and when only a fraction is used, it will be nearly a total waste.
Therefore only the 'needed' information at any moment is looked up and available trough the smarty tags.
So XOOPS stays lean and mean.

Login

Who's Online

267 user(s) are online (132 user(s) are browsing Support Forums)


Members: 0


Guests: 267


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits