Right now we are trying to implement a simple cms website using fuelcms. And I am stuck at showing a submenu on a page.
The problem is like this I have the
main menu:
1. A
2. B
3. C
For page A accessed form the above main menu I have on the left page a submenu with the following entries:
1. A1
2. A2
3. A3
I am using just one view for the all the menus content pages above.
I call the submenu like this:
<?php print fuel_nav(array('group_id' => 'categ', 'container_tag_id' => 'smenu', 'parent' => '8')); ?>
The problem is that because I specify the parent the when I am in the B page I am still getting the submenu from A.
What I am doing wrong?? I want to use the admin part to create the menu and the submenus for the website.
I have looked at the documentation and the blog but I was not able to find something about this.
Thanks
Comments
<?php print fuel_nav(array('group_id' => 'categ', 'container_tag_id' => 'smenu', 'parent' => ur_segment(1)); ?>
In this case, it will do a lookup in the database for the correct id associated with the uri_segment, then assign the parent to that ID value before rendering the menu.
http://dev.hype.ro/fuelcms/
BRUGER menu is having the ID 8 when accessing the HJÆLPER page I am still getting the submenu of BRUGER.
<?php
$this->db->select('*')->from('fuel_navigation')->where('nav_key', uri_segment(1))->limit('1');
$query = $this->db->get();
if($query->num_rows() > 0)
{
$query = $query->row();
$submenuID = $query->id;
}
$submenu = fuel_nav(array('group_id' => 'categ', 'container_tag_id' => 'smenu', 'parent' => $submenuID));
($submenu != "" ? print $submenu : print " ");
?>
<?php echo fuel_nav(array('container_tag_id' => 'sidemenu', 'parent' => uri_segment(1))); ?>
It doesn't work, if I use a page id, say 6. It will work. I looked into the fuel/modules/fuel/helpers/fuel_helper.php file around line 340.
I only see $val = eval_string($val); there, no search for the id of the uri_segment.