News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Single Category on Index Page

Started by alienwebguy, December 03, 2011, 10:17:20 PM

Previous topic - Next topic

alienwebguy

I am running SMF 2.0.1 and I would like to display a single category/forum in the index page.

There is a mod for this, but it does not support my version.  I don't mind manually making modifications, but this is my first forum in SM.... thought maybe someone could help.

Edit: I want to display the threads from a single category on the home page, like: www godlikeproductions com


Matthew K.

Hey there, and welcome to the SimpleMachines Community!

Please do not bump your topics within 24 hours of posting, we are all volunteers and even a 24 hour time-frame is pretty quickly, so we'd appreciate if you'd follow that.

In regards to your original post, have you looked at Portals on the mod site? They should allow you to do what you described.

Sir Osis of Liver

Not sure I understand the question, but if you have multiple categories and want to display only one on your main index, you can do this -

In BoardIndex.template.php find this:



foreach ($context['categories'] as $category)
{



Change it to this:



foreach ($context['categories'] as $category)

if ($category['id'] == 1)

{



Use the category id for the one you want to show.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

alienwebguy

@ Labradoodle-360  - Thank you, and my apologies  O:)  I will check out portals... hopefully I will find what I am looking for.

Quote from: Krash. on December 03, 2011, 11:30:10 PM
Not sure I understand the question, but if you have multiple categories and want to display only one on your main index, you can do this -

In BoardIndex.template.php find this:



foreach ($context['categories'] as $category)
{



Change it to this:



foreach ($context['categories'] as $category)

if ($category['id'] == 1)

{



Use the category id for the one you want to show.

I found the string and modified the file, but no change. I am using a alternate theme, and not the default theme. I look in the theme index, but there is no "foreach category" string.

Checking out portals now. All I want to do is have a single category, and list the threads for that category on the home page.

Any more ideas? Thank you for your time!

Thanks again Labradoodle-360

Sir Osis of Liver


Attach your BoardIndex.template.php

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

alienwebguy

Quote from: Krash. on December 03, 2011, 11:48:45 PM

Attach your BoardIndex.template.php

I will assume you mean the "core" boardindex.template.php file, right?

I woudn't think since I am using a custom theme that the default theme would be called. The theme I am using, BlackIbz_2, does not have a "BoardIndex.template.php" file. Just display and index template files.

The core board index is attached... hope it's the right one.

Matthew K.

Just use a Portal and use the articles system, that should do exactly what you want in a much better manner than hacking up a template.

alienwebguy

Quote from: Labradoodle-360 on December 04, 2011, 12:57:15 AM
Just use a Portal and use the articles system, that should do exactly what you want in a much better manner than hacking up a template.

Trying out PortaMx. The articles system doesn't do what I need...although PortaMx does add allot of control and flexibility to SMF.

I just want to display the threads from a single category on the home page.

Illori

there are other portals then just that one, try the others they may work better for you.

Sir Osis of Liver


No, it doesn't use /Themes/core/BoardIndex.template.php.  If the theme you're running doesn't have one, it uses /Themes/default/BoardIndex.template.php (that's why it's called 'default').

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: