News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Help customizing front page to not show BoardIndex

Started by ethomaz, July 10, 2014, 07:18:18 PM

Previous topic - Next topic

ethomaz

Hi.

I'm trying to make something different in my customization with the goal to show the same layout of MessageIndex (http://www.simplemachines.org/community/index.php?board=60.0) to the front page of my forum... the only difference is that it show the messages from all boards.

I don't want to change the source code of the SMF due future upgrades compatibilities... so I'm trying to find a way to do that only using templates but for now I failed because two points:

1) The BoardIndex template didn't receive any Topics information to display the table.
2) The MessageIndex didn't works without a selected board Id.

I could hide the Board Index in the BoardIndex.template saying just to display the board when ?action=boardindex... it works fine but after that I can't show the content of all boards in a way like the MessageIndex.template shows.

I tried to use some RecentTopics mods but they didn't shows the topics with sticks and others thngs like the MessageIndex.template.

I was thinking about to create a new template file where I will made a function with all the code needed to query and output the topics table based in the MessageIndex (the source) and MessageIndex.template and after that change the BoardIndex.template just to show what I want... something like that:

if($_REQUEST['action'] == 'boardindex')
{

echo '
<div id="boardindex_table">
<table class="table_list">';

... original BoardIndex.tempate code...

}
else
{
MyCustomFuncion();
}


There is any easier way? Any help will be appreciate.

Arantor

1. You will need to modify the top level index.php file, no way around that.
2. You will need to write new queries and new source.
3. You will need to write a new template.

Are you looking at having one board with everything on the front page, or copying the ridiculous, busy and demonstrably bad user experience of something like Nairaland (which doesn't even use SMF any more)?

ethomaz

Quote from: ‽ on July 10, 2014, 07:21:33 PM
1. You will need to modify the top level index.php file, no way around that.
2. You will need to write new queries and new source.
3. You will need to write a new template.

Are you looking at having one board with everything on the front page, or copying the ridiculous, busy and demonstrably bad user experience of something like Nairaland (which doesn't even use SMF any more)?
My first looks really showed I will need to modify the index.php, core source and template but that is not the way I want to works because I will lost future versions compatibilities... I don't want to change the core source or the main index.php file.

I do want the board categories working fine because I want to have all topics organized but I want to show in the main page a list of all Recent Topics with sticks and everything like the MessageIndex shows for one specific board.

I have some ideia but these are not the best one... so I'm trying to reach the community to see what I'm missing or even if it is impossible.

Thanks.

PS. I don't want this Nairaland mess ;)

Arantor

QuoteMy first looks really showed I will need to modify the index.php, core source and template but that is not the way I want to works because I will lost future versions compatibilities... I don't want to change the core source or the main index.php file.

It's pretty much not possible to bypass SMF's behaviour without doing that. There is... one horrible tangle of mess that would let you get out of it but frankly that's the less desirable option unless you know what you're doing.

So, your choices are: edit raw files or learn how to do some quite non-basic coding. And in *any* situation you'll need to replicate the message index template since it won't work properly even if you fetch the data and manually try to invoke it.

Long story short: it's doable but it's a lot of work for far less benefit than you'll probably get out of it, especially since if you replicate the layout there's no way to segregate topics by category in that layout... and to be honest it usually looks like a complete mess if you do try it, e.g. like http://what.thedailywtf.com/ (that's not SMF, but you get the point)

ethomaz


Burke ♞ Knight

Could try using a portal, and setting the portal to just be blocks of recent topics, one block per board could even be done, and set them to display all the topics, by setting the count up higher than the number of topics in each board.

That would leave the forum tab, for those who want to see the regular board index.

Arantor

Except using a portal makes modifications to core code...

Burke ♞ Knight

SimplePortal seems to do very little, compared to the rest, and usually makes it through updates.

Arantor

That might be because when preparing 2.0.7, Sinan and I made sure it worked as hassle-free as possible...

Advertisement: