I've just written a small replacement for submenu(), which will display the meta descriptions of the subpages (similar to the search function of CMSimple_XH 1.6).
You can place the following code in cmsimple/userfuncs.php:
Code: Select all
/**
* Renders the submenu including the meta descriptions of the subpages.
*
* @return string (X)HTML.
*
* @global int The index of the current page.
* @global array The configuration of the core.
* @global array The localization of the core.
* @global XH_PageDataRouter The page data facade.
*
* @copyright 2014 Christoph M. Becker <http://3-magi.net/>
* @license http://www.gnu.org/licenses/gpl-3.0.en.html GNU GPLv3
*/
function submenuex()
{
global $s, $cf, $tx, $pd_router;
$html = '';
if ($s > -1) {
$pages = new XH_Pages();
$children = $pages->children($s);
if (!empty($children)) {
$ml = min($cf['menu']['levels'] + 1, 6);
$html .= '<h' . $ml . '>' . $tx['submenu']['heading']
. '</h' . $ml . '>'
. '<ul class="submenu">';
foreach ($children as $child) {
$pd = $pd_router->find_page($child);
$html .= '<li>' . a($child, '') . $pages->heading($child) . '</a>';
if ($pd['description'] != '') {
$html .= '<p>' . XH_hsc($pd['description']) . '</p>';
}
$html .= '</li>';
}
$html .= '</ul>';
}
}
return $html;
}
Code: Select all
<?php echo submenu();?>
Code: Select all
<?php echo submenuex();?>
Christoph
PS: The AddOn requires CMSimple_XH 1.6 or higher!