Skip to main content
Topic: Front page (Read 4332 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Front page

While writing the home page addon for @Jorin I started wondering: why not use the hook to switch the home page at will?
So I decided to give it a try and put some code together, and I ended up with an hopefully easy admin and code interface to allow any controller become the front page.

If you don't know what a "Controller" is, think about it as "action=something".

So the attachments are a quick example of a couple of controllers I wrote as a demo: there is the board index (that is also the default, so it's a bit redundant) and there is the "message index" (described as "the content of a board") that allows to use a board as front page.
And the relevant code is:
https://github.com/elkarte/Elkarte/compare/elkarte:development...emanuele45:front_page?expand=1
what do you think? 1.1? O:-)

If not 1.1 then I'll put it together as an addon of course, though it will not be as effective, because I'll have to find some kind of "hack" to override the existing controllers, but I guess I'll be able to find something. :P

Re: Front page

Reply #1

I like it. One suggested change: create an interface Frontpage (or something) then you can make canFrontPage() return in_array('FrontPage', class_implements($this)); This way you are checking more than if the class says it can, you are checking if it has the required method(s) as well.

Or, you can just do that in getFrontPageControllers().

http://php.net/manual/en/function.class-implements.php

Re: Front page

Reply #2

Interesting idea. I'll give it a try!
Bugs creator.
Features destroyer.
Template killer.


Re: Front page

Reply #4

And now combine this with the opportunity to create pages within ElkArte with your own HTML code and choose them in your list too, and you have a small portal solution out of the box.  :D

Re: Front page

Reply #5

There is a bug in the current version.  The text  "Select the board to show on the front page:" overwrites the text "Members per page in member list" in the Standard drop selection.




Re: Front page

Reply #6

Someone messed up with closing stuff I guess ;D
~ SimplePortal Support Team ~

Re: Front page

Reply #7

Have tested the new feature. In my opinion it would be better for the selected board to create a Home button. Because when you choose a board as a home, you have no look at any other boards. Or is it a bug.

Even if it was a bug, I would find it better to create a separate menu button for a selected board.
 
Last Edit: September 17, 2015, 03:57:06 am by wintstar
Regards Stephan

Re: Front page

Reply #8

Quote from: Jorin – And now combine this with the opportunity to create pages within ElkArte with your own HTML code and choose them in your list too, and you have a small portal solution out of the box.  :D

I wrote an addon that does this :) I'll have to upload it to Github when I get a chance.

Re: Front page

Reply #9

can't wait for this addon. Nice one guys.