[dev] Spacing between menu <div> and content
Roel Gloudemans
roel at gloudemans.info
Sun Feb 6 10:11:28 PST 2005
Quoting Chuck Hagenbuch <chuck at horde.org>:
>> By the way, the image in the original post contains the top level
>> giapeto pages (works great for a community site). Would that be a
>> useful addition to have (as a global configurable item)? If so, I'll
>> create a patch (giapeto already has the api calls to do this)
>
> Say more - I'm not entirely sure what you're suggesting.
The proposal:
Add another option to conf.php. Setting this option results in the fact
that the Horde portal menu is expanded with the top-level giapeto
pages. We'll show these top-level pages outside the Horde tree (as
could be seen in the image).
I use this myself in a site I'm creating for a club. When logged in,
users still see the website main menu and the Horde tree with selected
modules. (phpNuke, or something like it, would probably a better choice
to use, but hey, I'm Horde addicted)
On the technical side: This can be realized by adding some code to
templates/portal/sidebar.inc (I know; i know, I should use Horde
classes to generate the URL's, but it's just a test)
The code I added just after <div id="sidebarPanel">
[code]
<ul class="mainlist">
<?php
if ($registry->hasMethod('cms/listPages')) {
$pages = $registry->call('cms/listPages', array());
/* We are looking for all pages starting with ..; but not .. .. */
foreach($pages as $pageid => $pagename) {
if (ereg("^\.\.\ [a-zA-Z]", $pagename)) {
echo '<li class="mainmenu" name="' . $pageid . '" id="' .
$pageid . '"><a class="mainlink"
href="../../giapeto/pages.php?page_id=' .
$registry->call('cms/getPageUrl',array($pageid)) . '"
target="horde_main" onmouseout="window.status=\'\'; DeSelectMain(\'' .
$pageid . '\');" onmouseover="window.status=\'Open pagina\';
SelectMain(\'' . $pageid . '\'); return true;">' . substr($pagename,3)
. '</a>';
} }
}
?>
</ul>
[/code]
It's probalby best to add another api call to Giapeto returning only
the top-level pages.
(I have one little problem with this code; it causes the menu to
collapse on reload. Any ideas?)
What dd'ya think?
Cheers,
Roel.
More information about the dev
mailing list