Re: Adding a menu? Newbie question...
On Mar 17, 2007, at 9:47 AM, Stacey wrote: > > hi all, > > i'm new to cakephp. i've read through most of the manual and have > completed the blog tutorial. i've got a decent feel for the basic > idea, but i'm confused about the best way to implement a menu. i'd > like to have the same menu on each page. i've coded the menu, and > could put it into the template, but i'm not sure how to set the > 'current' item in the menu. any help is appreciated...thanks. > > here is the html and css for a test menu i found. how can i include > this menu in my template, but dynamically set the (class="sel") for > the current item. One approach would be to place the HTML in a helper, check $this- >here to see what page you're on, and place some light logic in the element to set the classes according to the value of $this->here. -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Adding a menu? Newbie question...
hi all, i'm new to cakephp. i've read through most of the manual and have completed the blog tutorial. i've got a decent feel for the basic idea, but i'm confused about the best way to implement a menu. i'd like to have the same menu on each page. i've coded the menu, and could put it into the template, but i'm not sure how to set the 'current' item in the menu. any help is appreciated...thanks. here is the html and css for a test menu i found. how can i include this menu in my template, but dynamically set the (class="sel") for the current item. html: Navigation Introduction Hosting .htaccess files XHTML & CSS2 CSS and Images Perl and PHP XML & XSLT HTTP headers MySQL JavaScript Security Contact Me Homepage css: #leftbar { width: 25%; position: absolute; top: 0; left: 0; margin: 0; padding: 0; z-index: 0; } #navig { display: block; padding: 0; margin: 0; } #navig ul { margin: 0 0 2ex 0; width: 90%; padding: 0; } #navig li { display: block; width: 100%; list-style-type: none; list-style-position: outside; padding: 0; margin: 0; } #navig li.sel { display: block; background: #009900; color: inherit; } #navig a { display: block; background: #66cc00; border-left: solid #66cc00 3px; border-right: solid #66cc00 3px; border-top: 0; border-bottom: 0; color: black; text-decoration: none; font-family: sans-serif; width: 100%; padding: 2px 0 3px 0; font-weight: bold; font-size: 90%; margin: 1px 0 0 0; } #navig a:hover { border-left: solid #009900 3px; border-right: solid #009900 3px; } #navig li.sel a { display: block; background: #009900; border-left: solid #009900 3px; border-right: solid #009900 3px; color: #ccff66; } #navig .name { padding: 0 6px; } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---