Re: Tabs in Layout... Help Please.

2009-01-16 Thread Martin Westin
@Andrew The reason the "li.active" method is so widely used is that is works for CMSes and other "dynamic" applications where the contents of the menu changes. The technique you describe uses hard-coded menu items which I very rarely find to be sufficient for the applications I work on. On Jan

Re: Tabs in Layout... Help Please.

2009-01-15 Thread nurvzy
@Andrew: Thank you very much for the link to your great article; its well written and much appreciated. Thank you all for your quick responses, help and advice. Very much appreciated! Nick On Jan 15, 2:05 pm, "ache...@gmail.com" wrote: > Nurvzy, > > Yes! This is the first time I've written any

Re: Tabs in Layout... Help Please.

2009-01-15 Thread ache...@gmail.com
Nurvzy, Yes! This is the first time I've written anything and then been able to link to it. I don't like the idea of using your server to process this, I think it's a task much better suited to CSS I wrote about it here if you want to take a look http://www.lifeiscake.com/posts/view/css-menus Si

Re: Tabs in Layout... Help Please.

2009-01-14 Thread Kappa
Why not using "for_layout" variables? Just set into your controller action a "selectedtab_for_layout" variable and inside the layout (yes i said layout, not view) you can access it. On Jan 14, 5:42 pm, teknoid wrote: > If I understand this right, you are looking to set an "active" tab, > based

Re: Tabs in Layout... Help Please.

2009-01-14 Thread teknoid
If I understand this right, you are looking to set an "active" tab, based on the view you are currently in... It can be done easily from the view itself, i.e. in view_one.ctp: $this->set('tabOne', true); (which is now going to be available in your layout). Therefore, in the layout you could do:

Re: Tabs in Layout... Help Please.

2009-01-14 Thread nurvzy
A That's mighty clever too Martin, thanks for sharing. I have a static menu but I like the idea of not having to pass anything to the view and the layout figuring out where it is on its own. My problem is I'm using the same pages controller to display 3 of my 6 tabs with static content, so t

Re: Tabs in Layout... Help Please.

2009-01-14 Thread Martin Westin
One technique I have used where I want it to be as automatic as possible (but possibly not compatible with any routing scenario) is this: My main menu consists of either plugins or controllers (some of each kind.) So I use this to figure out what the current plugin or top- level controller is: -

Re: Tabs in Layout... Help Please.

2009-01-13 Thread nurvzy
Thank you Miles! That technique is exactly what I was looking for! Nick On Jan 13, 5:04 pm, Miles J wrote: > This is how I do mine: > > // controller action > function login() { >         $this->set('activeTab', 'login'); > > } > > // the view > > href="#">Login > > href="#">Signup > > Also, y

Re: Tabs in Layout... Help Please.

2009-01-13 Thread Miles J
This is how I do mine: // controller action function login() { $this->set('activeTab', 'login'); } // the view >Login >Signup Also, your function would go in the bootstrap.php file in your app/ config/ folder. --~--~-~--~~~---~--~~ You received this messa

Tabs in Layout... Help Please.

2009-01-13 Thread nurvzy
Hi All, I'm new to cakephp and working through my first cake app. I'm chugging along and am now stumped as to where to put a function I've written to help decide if a navigation tab should have the id="selected" assigned to the anchor tag. Basically the gist is I have a Navigation bar with v