Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: HIding Cat. from Category list  (Read 4039 times)

bobcat

  • Jr. Member
  • **
  • Karma: 1
  • Posts: 67
    • ESL Jobs by Country
HIding Cat. from Category list
« on: December 02, 2006, 12:25:38 PM »

Hi,

I have 5 categories currently on a rc3 snews 1.5 installation.

Because i have a menu bar up the top with one of my categories on it, i would now lie to hide it from the category list.

I.e. my categories are cat 1, cat 2, cat 3, cat 4, cat 5

cat 5 is included on the top menu bar so i would like to hide it.

Is there anyway to hide 'cat 5' in ??

Thanks for any help :)
BoB

Mohammed

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 59
    • http://www.mohamd.net/blog/
HIding Cat. from Category list
« Reply #1 on: December 04, 2006, 07:57:37 PM »

that sounds little hard for me to do,
maybe you should change it to display the first 4 categories and then hide the fifth one.
Logged
"People should not fear their government; governments should fear their people."
it's fairly possible..!

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
HIding Cat. from Category list
« Reply #2 on: December 04, 2006, 08:08:29 PM »

The only way I know of to have a category... but not have it display... is from the main Admin Panel:
- Click on View link beside Categories.
- Click on Editor for the Category you would like to hide.
- Un-check Publish Category and click the Editor button below the Panel to save.
- Your Category will still be in the Categories list, showing as un-pulbished, so you can activate it again.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Mohammed

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 59
    • http://www.mohamd.net/blog/
HIding Cat. from Category list
« Reply #3 on: December 05, 2006, 02:18:00 AM »

keyrocks, would that show the articles from the category?
i mean is that going to un-pulbished all the articles under this category?
Logged
"People should not fear their government; governments should fear their people."
it's fairly possible..!

Mika

  • Hero Member
  • *****
  • Karma: 9
  • Posts: 1377
    • http://www.ni5ni6.com/
HIding Cat. from Category list
« Reply #4 on: December 05, 2006, 06:24:37 AM »

Displaying limited amount of categories could be done like this:
Quote
function categories() {
...
# display first 4 categories ordered by catorder column value
$query = "SELECT * FROM ".db('prefix')."categories WHERE published = 'YES' ORDER BY catorder ASC LIMIT 4";
...
}
or like this:
Quote
function categories($limit) {
...
$query = "SELECT * FROM ".db('prefix')."categories WHERE published = 'YES' ORDER BY catorder ASC LIMIT $limit";
...
}
and then you can use it in your index page as follows:
Quote

which will give you more flexibility
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version