Miscellaneous

How can I display only one category on my main page?

Scenario:
"I only want one category to display on the home page, not postings from all categories. I went into settings and changed the default category to what I want but this setting seems to make no difference."

Solution:
Just do a little editing of your Main Index skin part and use an if conditional statement.

Original forum thread:
http://forum.nucleuscms.org/viewtopic.php?t=7121

Method:
Navigate to your Skins admin area by click on it in the left menu in the Nucleus admin area:

Click on the circled item to go to the skins admin area.

Select the main index skin part of the skin you are using (skin name will be in bold):

Click on the Main Index skin part to edit it.

In your Main Index skin, replace

<%blog(template,5)%>

Replace the code outlined in red.

with

<%if(category,categoryname)%>
<%blog(template,5)%>
<%else%>
<%blog(template,5,category)%>
<%endif%>

where "template" is the name of your template, "5" is the number of items you're displaying and "categoryname" is the name of the category you want displaying on your main page.

Put the code outlined in red where the previous code was.

section: Miscellaneous | submitted by Leng on 2005.Jun.03 | 4876 views

item rate
Total votes: 16 - Rating: 8.00

Please tell us how useful this answer was to you (0 = useless, 10 = very very helpful):

10