简体   繁体   中英

Main Menu Notification if there is an article update [Joomla 2.5]?

hello i am using joomla 2.5 , is there any extension to give notification such as star or image on main menu if there is a new article or content within category submitted for some period of time? let's just say if an article was submitted today, the main menu (Product type: category list) shows notification such as star or new label right next to the menu for about 3 days after the article was submitted.

you can override the mod_menu-template and add this functionality:

  • copy modules/mod_menu/tmpl/default_component.php to your template templates/yourtemplate/html/mod_menu/default_component.php
  • Edit default_component.php to check for new articles using your own criteria.

F.ex:

if($item->query['option']=='com_content' && $item->query['view']=='category' ){
$sql="select id from #__content where published=1 and catid="
.intval($item->query['id'])
." and created>='2014-03-27'";
$db=JFactory::getDbo();  
$db->setQuery($sql);
if(count($db->loadAssoc())) $item->title.='*';  
}

...thus, a * is added to the title if newest item is from 2014-03-27 or later...

regards Jonas

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM