【问题标题】:Main Menu Notification if there is an article update [Joomla 2.5]?如果有文章更新 [Joomla 2.5],主菜单通知?
【发布时间】:2014-03-25 15:09:26
【问题描述】:

你好我正在使用joomla 2.5,如果在一段时间内提交了新文章或类别内的内容,是否有任何扩展程序可以在主菜单上提供诸如星标或图像之类的通知? 假设今天提交了一篇文章,主菜单(产品类型:类别列表)在文章提交后大约 3 天的时间里会在菜单旁边显示星标或新标签等通知。

【问题讨论】:

    标签: php joomla joomla2.5 joomla-extensions


    【解决方案1】:

    您可以覆盖 mod_menu-template 并添加此功能:

    • 将 modules/mod_menu/tmpl/default_component.php 复制到您的模板 templates/yourtemplate/html/mod_menu/default_component.php
    • 编辑 default_component.php 以使用您自己的标准检查新文章。

    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.='*';  
    }
    

    ...因此,如果最新项目来自 2014-03-27 或更晚...

    问候乔纳斯

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-02-10
      • 2013-03-15
      • 2012-07-12
      • 1970-01-01
      • 1970-01-01
      • 2013-01-12
      • 1970-01-01
      相关资源
      最近更新 更多