template functions
Suppose for a moment one wanted to rework the templates. Like all of them. Maybe even add a few additional functions to existing templates. Where would the new function call need to be added? What about entirely new actions, where would those need to be loaded and called?
This may be an overly ambitious project. Still, there may be attempts at forward progress until it either happens or becomes overly daunting. Lol! Thanks, hope everyone has a great weekend!
Re: template functions
Reply #3 –
What I'm thinking is changing everything about the layout and navigation. All of it. More or less that means changing both template tiers....function level as well as file level.
But to simplify the question, let's say hypothetically there is to be a whole new function to be created in the who's online action. That action contains a couple of functions already. The online list itself, and the credits. So if we were to add function foo, where would it be loaded and called in order to be rendered in the page?
Re: template functions
Reply #4 –
If I got it right, the answer may look like: "source" (i.e. anything contained in the "sources" directory) has few... things that cannot be changed by the theme, and are the names of some functions.
These names are just the "sub-templates" and the "layers" referenced within the code.
So, for example, the function "template_boards_list" shall be present (because "boards_list" is the sub-template used by the BoardIndex controller).
That said, what this function does... well, it's up to the themer. You can even decide to leave it empty.
This is anyway only partially true, in theory you could change the name of the sub-template from within the theme, but that's a bit hackish at the moment and inconsistent across templates, so it may work in one place, but not in another, so I'll not describe how to do it.
Following your example (and based only on the names of the functions/files), I would say that:
1) you have to look into the "Who.template.php" file,
2) template_whos_online is responsible for the main list of members on line (so it's a sub-template and is the one called to render the page and shall stay),
3) template_whos_selection_above and template_whos_selection_below (based on the fact the functions end in "_above" and "_below") are a "layer" added around the sub-template, they could stay or not, it's not important.
So, to create a completely new page, the only thing you are forced to maintain is a function called "template_whos_online", then you can create inside Who.template.php almost any other function you want, and you can call those functions from anywhere you like (speaking about the who is online page).