Mar 1, 2004, 6:39 PM
Veteran / Moderator (6956 posts)
Mar 1, 2004, 6:39 PM
Post #3 of 6
Views: 2579
HTML should be loadable from files, rather than embedded in code anyway.
If you put the html in the globals file, you enlarge the file, and thus overhead for each instance of running code. If you have it in a template file, it's compiled once, and loaded from the ../compiled directory.
So, which is more efficient depends on what your needs are.
Also, writing "big" globals is not a good idea. You'd be better off to put them in a module, and load the module from the Plugins:: area, using the <%Plugins::Module::Name%> syntax. That way, you have more control over your code layout, and a more logical structure -- while limiting overhead in the globals.txt file.
globals should be small snippets, that are called often, or on multiple templates. They are things that you can put in one place, and edit easily, to make site-wide changes.
Though, often overlooked, the modular layout allows easy integration of external modules into the templates. Quite complex things can be called, and it's easier to modify and edit a .pm file than the globals.txt. You also have more control over what goes on in the set up of the .pm file.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.