Skip to main content
Topic: The Boardindex/Frontpage option (Read 607 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

The Boardindex/Frontpage option

Just wanted to say the option(and hook for mods) to present a frontpage is great.  :)  Its one of those portal things that - at least in SMF2.0.x - requires more modding than should be necessary. In Elkarte its simply an extra option.

Good call!  ;D

Re: The Boardindex/Frontpage option

Reply #1
Thanks! :D
Bugs creator.
Features destroyer.
Template killer.

Re: The Boardindex/Frontpage option

Reply #2
Without looking(as I probably should :P and I will ) ..are there other hooks that help with a portal-like function? Something alike to panels around content for example?

Also, I assume there are hooks to add custom actions?

What about built-in ajax..being able to fetch content without leaving the page, any already exiting functions to utilize there? I reckon there are JQuery plugins out there, but curious as this is something the devs have already thought of, in Elkarte.

Re: The Boardindex/Frontpage option

Reply #3
The way the "feature" works is to delegate everything in that page to each controller.
Basically, the controller has to "support" the front page view, so that it can be selected from the admin panel (it has to have a couple of defined methods) and then it has to have a specific method that is called on the front page if the controller is selected to be shown.

The example of the "recent posts", this is the Recent_Controller that controls the page.
It has:
public static function frontPageOptions
that allows him to "be selected" from the admin panel (actually the controller has to have also public static function canFrontPage in order to "tell" the admin panel it can actually be used as front page).
Then it has:
public static function frontPageHook
that is called when Recent_Controller is set as front page and is the responsible for showing the page.

There is no centralization in that case, so to extend it you create your own controller with the features you want and you use it.
SP (the development version) is already using it, here you can see the functions:
Bugs creator.
Features destroyer.
Template killer.

Re: The Boardindex/Frontpage option

Reply #4
Neat. :)

Actually, it would seem that when building a portal for Elkarte, the "frontpage"bit should rather be left to core itself, so that other mods might correctly be set as well, as the frontpage if the admin wants. Well, adding your own brew of it course..but not take completely over as done in SMF 2.0.x portals. I like this. :)

Theme-wise I see that the less the theme adds of its own custom things the better (its no secret I like to build a lot into a theme that otherwise you would need mods for in SMF), giving mods a chance to be what they can be, big or small. But the CSS have to go.  8)


Re: The Boardindex/Frontpage option

Reply #5
Yep, it is meant to leave the admin the option to use whatever he wants.

Regarding the theme is no secret I would love to use some sort of templating engine, but first I would like to see so many other things implemented that is still basically a dream (like reduce the number of templates, "modularize" the templates extracting and reusing common features, sort of standardize the variable used and maybe avoiding globals (see what I did with SP blocks, with "data" passed as argument to the template function), etc. and this only for the themes).
That said, if the themes  were to use a templating engine, nothing forbid to have an install procedure able to upload an addon that has to be enabled before using the theme. O:-)
Bugs creator.
Features destroyer.
Template killer.


Re: The Boardindex/Frontpage option

Reply #6
Well, its a question of where you want Elkarte to go of course.

Mind you though, there's no guarantee that more designers will be interested in making themes(or admins changing their design) even with a new/easier templating system. If it also adds overhead to the script and its own set of problems with that - well, then its better to stick with what you got I would say.

I do believe in making themes/templates OOP though, personally. I did that in Protendo and it was a revelation to be able to override single subtemplate in one single template - or changing every template there...and adding a few of its own too. The theme system in SMF/Elkarte have always been powerful and tempting to utilize fully..but the amount of very different templates is IMHO its biggest weakness. Extracting out common things, as you say, its a way forward no doubt. I got some way in said Protendo, but my skills are the momentum stopped then.

Either way, Elkarte is more powerful than SMF 2/2.1 now, both in features and themes IMO.