Administrator
Administrator
fretzl   2012-11-29, 16:16
#1

Scenario:
A menu with a "News" link to news.php.
This link is wrapped in some HTML.
What I'd like is: to not print the HTML/News-link if there is are no news-tems or only unpublished news-items.

Any tips ?

Administrator
Administrator
acrylian   2012-11-29, 16:41
#2

If using the official menus, no way without modifiying. If a custom (static) menu try getNumNews(). It uses the class method getArticles/getCombiNews internally so it should not return unpublished items unless - as alway - loggedin with the appropiate rights.

Administrator
Administrator
fretzl   2012-11-29, 16:54
#3

Thanks. I'll give it a try.

Administrator
Administrator
fretzl   2012-11-30, 06:00
#4

Works great!
if(getNumNews(true) > 0) {....}

Administrator
Administrator
acrylian   2012-11-30, 10:35
#5

I guess, If not you would have had found a bug..;-)

Member
Member
vincent3569   2012-11-30, 19:10
#6

Hi
btw, in zpArdoise, I only use
if (getNumNews() > 0) {...}

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.