嗨,我只想在美德玛特的首页上显示模块,而不希望在内页上显示该模块。我对此进行了搜索,但没有得到任何信息。
我尝试使用此代码,但没有效果。
<?php if (JRequest::getVar('view')=='productdetails') { ?>
<div id="productmod"><jdoc:include type="modules" name="productdetails" /></div>
<?php } ?>
谁能帮我解决这个问题
提前致谢..
嗨,我只想在美德玛特的首页上显示模块,而不希望在内页上显示该模块。我对此进行了搜索,但没有得到任何信息。
我尝试使用此代码,但没有效果。
<?php if (JRequest::getVar('view')=='productdetails') { ?>
<div id="productmod"><jdoc:include type="modules" name="productdetails" /></div>
<?php } ?>
谁能帮我解决这个问题
提前致谢..
查看答案,然后var_dump获取$menuList所有菜单,然后获取特定菜单并应用您的条件..
// Get default menu - JMenu object, look at JMenu api docs
$menu = JFactory::getApplication()->getMenu();
// Get menu items - array with menu items
$menuList = $menu->getMenu();
// Look through the menu structure, once you understand it
// do a loop and find the link that you need.
var_dump($menuList);
查看给出的链接如何确定首页或默认页面