• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pseudo URI Segment for menu highlighting


i need something like a "pseudo" URI-Segment. At the moment i got the following structue:

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]

//route example: http://domain.tld/en/controller => http://domain.tld/controller
$route['(\w{2})/(.*)'] = '$2';
$route['(\w{2})'] = $route['default_controller'];

i wanna declare a dynamical menu highlighting for every method (active / non active tabs).

the easiest solution is a pseudo segment for the uri, isnt it ?

For example:

How can I add it to my structure without destroying something ? (that "menu" is ignored as controller, only reachable about $this->uri->segment(1); ?

Maybe any other ideas how to solve it ?


[eluser]Damien K.[/eluser]
My preference is to stick ui/view logics in the view only (i.e., JavaScript/CSS implemenation).

i won't load the templates via ajax if you mean this. and javascript can't remember which menu point was selected before a reload.

[eluser]Damien K.[/eluser]
Fine, do it your way! Smile

I see your original question now, but I don't quite understand what you're trying to achieve. If you can explain more...

the easy explaination:

i just wanna put a "dummy" segment to the uri, but i dont know how to take the controller name from the third segment..

for example:



the "visitor" segment is only to highlight the current menu ...

better now ? :-)

[eluser]Damien K.[/eluser]
No really, but you're in luck 'cause I'm a part-time psychic. Smile

So the segments must be 'real' but need to be 'by-passed' as a controller.

This is outside my expertise (or, really, intrinsically supported by CI). Thus, no suggestion at the moment. Will post back when something comes to mind. Of course, you can hack CI at will.

Well if your on that page then you know which menu item to highlight and make Active!


i've several pages that are linked from different menus ... for example i've http://www.example.com/menu1/exhibitorservice/list and http://www.example.com/menu2/exhibitorservice/list

that's the problem i have. more then one link to some pages. (with different menu highlighting)

[eluser]Damien K.[/eluser]
Yeah, hykoh insist on an interesting setup. Unconventional ways of doing things requires unconventional ways to solve it. I'm intrigued to know why you choose to implement/support menu in such a manner. It is fairly clear that this "issue" would come up.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.