ElkArte Community

Elk Development => Feature Discussion => Topic started by: emanuele on September 15, 2014, 05:43:30 am

Title: [BoardIndex] replace boards/categories with "something else"
Post by: emanuele on September 15, 2014, 05:43:30 am
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.
Title: Re: [BoardIndex] replace boards/categories with "something else"
Post by: Spuds on September 15, 2014, 08:37:18 am
Oooo I like this idea  :D
Title: Re: [BoardIndex] replace boards/categories with "something else"
Post by: emanuele on September 15, 2014, 11:49:58 am
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.
Title: Re: [BoardIndex] replace boards/categories with "something else"
Post by: Jorin on September 16, 2014, 10:05:59 am
Sorry, I can't follow you guys, but I'm sure it will work.  :D
Title: Re: [BoardIndex] replace boards/categories with "something else"
Post by: emanuele on September 16, 2014, 10:12:22 am
Don't worry, I'll show the result sooner or later! :P