Skip to main content
Topic: How Can I Show Recent Posts Below Site News on Index Page (Read 1614 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How Can I Show Recent Posts Below Site News on Index Page

On the default theme (the same one used by this forum) How do I move the recent posts segment which is shown at the bottom of the homepage (inside infor center)?

I will like this segment to be shown near the top of the website (beneath the Site news slider).

Re: How Can I Show Recent Posts Below Site News on Index Page

Reply #1

If you just want the "info center" at the top of the page, then you will have to edit the BoardIndex.tempate.php file and rename the function function template_info_center_below() to be function template_info_center_above() ... Thats a quick hack but other than that there is not built in setting to set those things to thte top.  You would need to edit your theme or possibly use a portal addon.

Re: How Can I Show Recent Posts Below Site News on Index Page

Reply #2

Hello spuds thanks for the quick response and for the hack.

What I really need is to have only the recent posts part of the info center showing above. The rest things in the info center will still remain below in their original position. I don't mind editing the template (IF I know where to edit)

Can this be done with a portal plugin? Is there any particular one you could recommend or maybe point me in the right direction where I can find one.

Re: How Can I Show Recent Posts Below Site News on Index Page

Reply #3

Yes. Portal can do that too. Any portal would do but I 'd prefer Simple Portal.

Re: How Can I Show Recent Posts Below Site News on Index Page

Reply #4

The only other quick hack is to add the following the following function  to your original (without the previous hack) BoardIndex.template file.  Just add it above the function  template_info_center_below()
Code: [Select]
function template_info_center_above()
{
global $context, $txt;

if (($key = array_search('recent_posts', $context['info_center_callbacks'])) !== false)
{
unset($context['info_center_callbacks'][$key]);

// Here's where the "Info Center" starts...
echo '
<aside id="info_center_top" class="forum_category">
<h2 class="category_header panel_toggle">
<i id="upshrink_ic2" class="hide chevricon i-chevron-', empty($context['minmax_preferences']['info2']) ? 'up' : 'down', '" title="', $txt['hide'], '"></i>
<a href="#" id="upshrink_link2">', sprintf($txt['info_center_title'], $context['forum_name_html_safe']), '</a>
</h2>
<ul id="upshrinkHeaderIC2" class="category_boards', empty($context['minmax_preferences']['info2']) ? '' : ' hide', '">';

call_template_callbacks('ic', array(0 => 'recent_posts'));


echo '
</ul>
</aside>';
}
}
The collapse / expand icon will not work with this, you would have to add your own JS based on the JS function in the _below function, just renaming some things.

Re: How Can I Show Recent Posts Below Site News on Index Page

Reply #5

Quote from: Spuds – The collapse / expand icon will not work with this, you would have to add your own JS based on the JS function in the _below function, just renaming some things.
The second hack worked fine and is good enough for me even without the collapse working (although if you could help with this I wouldn't mind).

Really appreciate your help. thanks a lot for your time.


Quote from: ahrasis – Yes. Portal can do that too. Any portal would do but I 'd prefer Simple Portal.
Thanks I will check it out.

Re: How Can I Show Recent Posts Below Site News on Index Page

Reply #6

Just start with the function in the _below function, copy it to the _above function.  Then it should only require a few name edits to point to the id="xxx" values that are in the _above  ... get jiggy wit it  and if you get stuck then post what you have ;)

Re: How Can I Show Recent Posts Below Site News on Index Page

Reply #7

okay thanks a lot for the pointer I will try my best