[typo] Layouts help needed

Sanjay Bisht crazy.bisht at gmail.com
Sun Dec 30 13:32:33 EST 2007


Hey,

Even I was thinking on the same lines, but somehow it's not giving me the
satisfaction (the one that you get when you know the job is perfectly done
:) ). I guess that I will have to try the else-if loop only.

Thanks and regards

On Dec 30, 2007 11:39 PM, Frederic de Villamil <frederic at de-villamil.com>
wrote:

> Hello,
> Even tough I hate using conditionnal statement in themes, the solution I
> use is
>
> if controller.controller_name == 'foobar' and controller.action_name ==
> 'foobar'
> do something
> else
> do soemthing else
> end
>
> Hope this helps
> Fred
>
> Le 30 déc. 07 à 18:18, Ben Reubenstein a écrit :
>
> Hi ~
> You would implement this by checking if the controller/action is the index
> page on the layout for your theme.  If it is you would render a different
> partial.  I guess you could do it with a before_filter too that dynamically
> assigned the layout, but this could get messy since you would be messing
> with the Typo source.
>
> ~ Ben
>
> On 12/30/07, Sanjay Bisht <crazy.bisht at gmail.com > wrote:
> >
> > Hi Piers,
> >
> > Can you please explain as to what you just mentioned. I did not
> > understand you perfectly.
> >
> > On Dec 30, 2007 8:12 PM, Piers Cawley < pdcawley at bofh.org.uk > wrote:
> >
> > > On 12/30/07, Sanjay Bisht < crazy.bisht at gmail.com> wrote:
> > > > Hi,
> > > >
> > > > I am trying to create a new theme for Typo. For this I want the
> > > index page
> > > > to have a different layout than the rest of the pages. Can someone
> > > please
> > > > help me in this direction, as to how can I set up a new layout for
> > > the index
> > > > page apart from the default layout.
> > >
> > >
> > > You can't. Well, not directly. You'd have to have a test in the
> > > default layout and have it select the actual layout partial to use.
> > > _______________________________________________
> > > Typo-list mailing list
> > > Typo-list at rubyforge.org
> > > http://rubyforge.org/mailman/listinfo/typo-list
> > >
> >
> >
> > _______________________________________________
> > Typo-list mailing list
> > Typo-list at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/typo-list
> >
>
>
>
> --
> Ben Reubenstein
> 303-947-0446
> http://www.x-cr.com
> _______________________________________________
> Typo-list mailing list
> Typo-list at rubyforge.org
> http://rubyforge.org/mailman/listinfo/typo-list
>
>
>
> _______________________________________________
> Typo-list mailing list
> Typo-list at rubyforge.org
> http://rubyforge.org/mailman/listinfo/typo-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/typo-list/attachments/20071231/5b80ab40/attachment-0001.html 


More information about the Typo-list mailing list