CodeIgniter Forums
Pseudo URI Segment for menu highlighting - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Pseudo URI Segment for menu highlighting (/showthread.php?tid=23285)



Pseudo URI Segment for menu highlighting - El Forum - 10-06-2009

[eluser]hykoh[/eluser]
Hi,

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

.htaccess
Code:
<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]
</IfModule>

routes.php:
Code:
//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:
http://domain.tld/en/menu/controller/method

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 ?

Thanks


Pseudo URI Segment for menu highlighting - El Forum - 10-07-2009

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


Pseudo URI Segment for menu highlighting - El Forum - 10-07-2009

[eluser]hykoh[/eluser]
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.


Pseudo URI Segment for menu highlighting - El Forum - 10-08-2009

[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...


Pseudo URI Segment for menu highlighting - El Forum - 10-08-2009

[eluser]hykoh[/eluser]
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:

before:
Code:
http://www.example.com/en/controller/method/id

after:
Code:
http://www.example.com/en/visitor/controller/method/id

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

better now ? :-)


Pseudo URI Segment for menu highlighting - El Forum - 10-08-2009

[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.


Pseudo URI Segment for menu highlighting - El Forum - 10-08-2009

[eluser]InsiteFX[/eluser]
Well if your on that page then you know which menu item to highlight and make Active!

Enjoy
InsiteFX


Pseudo URI Segment for menu highlighting - El Forum - 10-09-2009

[eluser]hykoh[/eluser]
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)


Pseudo URI Segment for menu highlighting - El Forum - 10-09-2009

[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.