我需要输出每个'文章','Id',它们一次性链接在菜单中,全部在一个页面中,每个都在div id = articleID中。输出可以是带模块的句柄,我可以在joomla 2.5中安装和更新这个模块
答案 0 :(得分:0)
以下代码应该:
// init
$searchBase = 'index.php?option=com_content&view=article&id=';
$articles = array();
// get all menu items and find links to articles
$menu = JFactory::getApplication()->getMenu()->getItems('type', 'component');
foreach ($items as $item) {
$id = str_replace($searchBase, '', $item->link, $count);
if ($count){
$articles[] = (int) $id;
}
}
// build query for articles info
$csvIds = implode(',', $articles);
$sql = "select id, title from #__content WHERE published=1 AND id IN ($csvIds)";
// TODO: query and process