Ok, going to contradict that, don't include the for-each!!
Reason being is, it then has to secondary look for them, once it includes the file.
It is better to have for-each, include this in theme.html… as then it optimizes the uses of this Js cache functionality after to place that file in each.
This optimization works best on Mac (old tangerine I-book (antique) used for tests, so very impressive results, in comparison of Xoops.org and Wizanda.com using safari)
For once Internet Explorer IE works much faster then FireFox…. reason is it seems, is that the Java-Script caching function of Internet Explorer seems to work more intuitively with Windows and to keep more of the html stored as JS in the system, rather then loading it each time. (have a look, sort of explains Wiz-and-a
)
What we want to do is minimise the theme.html to be as small as it can be, yet also to include as much as possible.
(spiders web =
one center point = theme.html,
strands outwards = files.js,
Center circles and filling of web = Smarty, PHP, Mysql)
So any time we are going to run anything that requires to many quires in html, from the same file, we can move parts to .JS files instead of html either block support or items within a theme such as login and search…..
Making the html, right block, left block, center etc all in .js files instead will reduce recursive loading times, so making a more surf-able site (after first loading).
Now also in our own themes since when you basically include, it goes to /themes/ and not to the end directory (you must add the theme directory also).
What I have done, is over the site certain bits are used the same for each theme, yet just contain a different CSS, so these are now all in the themes directory (for after-caching).
You see after the first time you load our site, it may be slower, yet then it wiz-and-a’s as you surf, as once all the .js files are loaded into your computer, they remain and reduce concurrent loading time after.
Users.js
Admin.js
Guest.js
Else.js
Each of them is only included in a <{if}> statement so, then if a guest, include this .js file….rather then make it load in the theme.html; so reducing its basic weight of file and reduces reading time overall.
Multimenu.js
Search.js
This list could go on to be key features much like our block of smarty are, yet Caching in Java-script for the parts needed to surround Smarty…
The logic behind all of this is that if Smarty includes the .js file which only contains normal html…the .js file will:
1) Stores this in the user computer after loading, rather then reloading from the site (depending what browser used on cache time)
2) Make it that the completion time of each page is faster, if Smarty can access the data as fast, as the page can be displayed (requires MySql optimization also).
3) Will automate complicated html in micro-seconds, rather then seconds, as the time required to inform a browser of the html is longer.
4) Make cross site themes faster, using the same js.file reduce loading time.
5) As a possibility and still unsure on this, the Smarty Ajax system calls Java function and am unsure if we can make every call Ajaxed also…(will see
……..
Hope this all make sense you are just placing html in a .js file and it will load twice as fast….
Now with XOOPS we have to be careful of that we don’t cross the two i.e. Smarty and Java-script as they are said not to suit….yet in this case we are not using Java-script, we are merely placing the existing html in a Java-Script cache, on the outside of where Smarty is working, to give Smarty the required data it includes there, to also be what it then looks for in one go.