MaMo Net



#1 29.06.2009, 08:34
Shyra Abwesend
Mitglied
Dabei seit: 29.06.2009
Beiträge: 3


Betreff: Collapsible Menu
Is it possible to to make the navigation menus collapsible? i.e.:
↑  ↓

#2 29.06.2009, 08:50
MaMo Abwesend
Administrator
Dabei seit: 06.04.2004
Beiträge: 2.675


Betreff: Re: Collapsible Menu
Where is the example? Smiling
Matthias M.
=> Support nur per Forum - dann haben alle etwas davon!
↑  ↓

#3 29.06.2009, 21:25
Shyra Abwesend
Mitglied
Dabei seit: 29.06.2009
Beiträge: 3


Betreff: Re: Collapsible Menu
A good example would be the menu in the Admin Control Panel of Viscacha. You can collapse all, expand all, or collapse by section.

I want to combine my personal site and my forum into one "same-design" package, and delegate some of the update work to a couple of co-admins. Since I want the forums to become public accessible, I was very excited to find your package.

My co-admins are not web developers nor do they know any coding. I need help in updating the site because of it's size. It's currently 717 pages and I have MUCH more to add when I settle on an upgrade path.

If you want to check the main website, which is what I want to convert to Viscacha, you can check out http://www.tryskelion.com. I HATE the Navigation I currently have on the page!

I'm using IntegraMod for my forum, hoping I could add a knowledge base for the website there, but that didn't work out AND IntegraMod's not been updated for 2 years.

I started redesigning the site with a collapsible tree menu, thinking I'd just link to a plain phpbb forum addon, but I'd MUCH rather convert to Viscacha, if possible. The only thing that's holding me back is a collapsible tree menu on the left side navigation menu.

Thanks!
Dieser Beitrag wurde 1 mal editiert, das letzte Mal am 29.06.2009, 21:27 von Shyra. ↑  ↓

#4 30.06.2009, 02:26
MaMo Abwesend
Administrator
Dabei seit: 06.04.2004
Beiträge: 2.675


Betreff: Re: Collapsible Menu
Hi,

mhhh I don't have experience with tree menus, but a menu like in the Admin Control Panel is very easy to do, because all the things you need are already on board (and used in the Admin Control Panel). So if this is the way you want to have it, just let me know and I will write something down for you...

I am going to New Zealand for the next 9 days so it may take some time to do this...

Regards
MaMo
Matthias M.
=> Support nur per Forum - dann haben alle etwas davon!
↑  ↓

#5 30.06.2009, 04:03
Shyra Abwesend
Mitglied
Dabei seit: 29.06.2009
Beiträge: 3


Betreff: Re: Collapsible Menu
New Zealand, eh? I'm jealous! Wink

Yes, I'd be very interested... like I said, a cms/forum combo is really the way I'd like to go... Thank you!
↑  ↓

#6 30.06.2009, 07:46
MaMo Abwesend
Administrator
Dabei seit: 06.04.2004
Beiträge: 2.675


Betreff: Re: Collapsible Menu
Hi,

it should be very easy to implement that.
Open the template file modules/navigation.html and save it with the following content:
DownloadText-Quelltext:
  1. <div class="navigation_cat">
  2. <h3>
  3.         <img id="img_mnav_<?php echo $row['id']; ?>" alt="switch" src="<?php echo $tpl->img('minus'); ?>" title="<?php echo $lang->phrase('box_collapse'); ?>" />
  4.         <?php echo $row['name']; ?>
  5. </h3>
  6. <ul class="navigation_inner" id="part_mnav_<?php echo $row['id']; ?>">
  7. <?php foreach ($navigation as $sub) { ?>
  8.         <?php if(!empty($sub['link'])) { ?>
  9.                 <li><a href="<?php echo $sub['link']; ?>"<?php echo iif(!empty($sub['param']), ' target="'.$sub['param'].'"'); ?>><?php echo $sub['name']; ?></a>
  10.         <?php } else { ?>
  11.                 <li><strong><?php echo $sub['name']; ?></strong>
  12.         <?php } if (count($sub['navigation']) > 0) { ?>
  13.         <ul>
  14.         <?php foreach ($sub['navigation'] as $sub) { ?>
  15.                 <?php if(!empty($sub['link'])) { ?>
  16.                         <li><a href="<?php echo $sub['link']; ?>"<?php echo iif(!empty($sub['param']), ' target="'.$sub['param'].'"'); ?>><?php echo $sub['name']; ?></a>
  17.                 <?php } else { ?>
  18.                         <li><strong><?php echo $sub['name']; ?></strong>
  19.                 <?php } ?>
  20.                 </li>
  21.         <?php } ?>
  22.         </ul>
  23.         <?php } ?></li>
  24. <?php } ?>
  25. </ul>
  26. </div>

This is the default template file with the additional button to open/close the box.
The new button code is:
    <img id="img_mnav_<?php echo $row['id']; ?>" alt="switch" src="<?php echo $tpl->img('minus'); ?>" title="<?php echo $lang->phrase('box_collapse'); ?>" />

The part that should be hidden just needs an id:
id="part_mnav_<?php echo $row['id']; ?>"

The green part in both code snippets is the unique id for each box so you can easily adopt it to other things aswell. Alright?

Cheers
MaMo
Matthias M.
=> Support nur per Forum - dann haben alle etwas davon!
Dieser Beitrag wurde 1 mal editiert, das letzte Mal am 30.06.2009, 07:47 von MaMo. ↑  ↓

Seiten (1): 1


Alle Zeitangaben in GMT +02:00. Aktuelle Uhrzeit: 04:42.