Skip to main content
Topic: [BoardIndex] replace boards/categories with "something else" (Read 1743 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[BoardIndex] replace boards/categories with "something else"

At the moment a board can be set as a redirect, but what if Elk would allow to "replace" the "board-view" in the board index with a custom template doing custom things?
Or an entire category?

"Replace" (in quotes) because it wouldn't be a real replace, it would be more like call the appropriate template at the right time.
In other words, it would be a matter of changing the at about this position:
https://github.com/elkarte/Elkarte/blob/v1.0.0/themes/default/BoardIndex.template.php#L58
more or less like this:
Code: [Select]
			if (!empty($category['template_callback']))
$category['template_callback']($category['boards'], 'category_' . $category['id'] . '_boards');
// Assuming the category hasn't been collapsed...
elseif (!$category['is_collapsed'])
template_list_boards($category['boards'], 'category_' . $category['id'] . '_boards');
and something similar for each board around here:
https://github.com/elkarte/Elkarte/blob/v1.0.0/themes/default/GenericBoards.template.php#L104
but preserving the <li> in order to avoid markup issues.
Bugs creator.
Features destroyer.
Template killer.

Re: [BoardIndex] replace boards/categories with "something else"

Reply #1

Oooo I like this idea  :D

Re: [BoardIndex] replace boards/categories with "something else"

Reply #2

And, while thinking about it, I realised that this solution would allow to "extract" the redirects code in its own function, simplifying even more the code that displays the boards.
Yes, a little bit of duplication, true, but a lot more of flexibility. I think.
Bugs creator.
Features destroyer.
Template killer.

Re: [BoardIndex] replace boards/categories with "something else"

Reply #3

Sorry, I can't follow you guys, but I'm sure it will work.  :D

Re: [BoardIndex] replace boards/categories with "something else"

Reply #4

Don't worry, I'll show the result sooner or later! :P
Bugs creator.
Features destroyer.
Template killer.