The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Aug 31, 2007 10:04 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Aug 20, 2006 8:56 pm
Posts: 21
Location: Muenster, Germany
Hi everyone,

I want to enlarge an existing website with a new "News" menu (Blog - Content Category). However, there will be times when there are no content items to display, because none are currently published. Instead of getting a "There are no Items to display" message, I want the menu item itself to disappear. When a content item is published, I want the menu item to re-appear. I'll happily split the navigation into two separate modules: one "news" module that can be unloaded, and another menu module including all the other menu items that is always visible.

Unfortunaely, I do know nothing about PHP. But I assume that it must be possible to
a) determine the number of currently active content items within a given content category and
b) hide (i.e. "not load") the news module when the number of acive items is zero.
The idea came to me when I saw this in the Solarflare II template:
Code:
if ( mosCountModules( 'top' ) ) { mosLoadModules ( 'top', -2 ); }


Could someone help me with the bit of code that is required to acomplish this?

Thank you from
cooperate!

_________________
Greetings from cooperate


Top
 Profile  
 
PostPosted: Sat Sep 01, 2007 10:02 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Aug 23, 2006 4:37 am
Posts: 18
You need a new menu module.

_________________
http://pachay.com
Free templates and component for Joomla.


Top
 Profile  
 
PostPosted: Sat Sep 01, 2007 1:55 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Aug 20, 2006 8:56 pm
Posts: 21
Location: Muenster, Germany
fadine wrote:
You need a new menu module.

I am happy with that.
What I need is help with a piece of code for the template, that
1) queries the database for published items in the category "news" (or its respective category id),
2) returns the number of currently active items, and
3) loads the module *only* if the item number is >0.

I've searched the developer pages already, but I just don't know enough about PHP and MySQL queries to have any hope of actually doing it myself... Any help?

_________________
Greetings from cooperate


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 



Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group