rubyonrailsin

A Ruby and Rails talk

Thursday, March 11, 2010


Re: [Radiant-Dev] Re: Radiant snippets and layouts, Practical problem building my first Radiant site

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

I just pick the layout for each child page under the home, but I do
agree it is annoying. I'm sure there is a way that we could set the
preferred layout using something like the settings extension.
Radiant.default_layout = normal, or something. That would simply use
the setting unless the layout was specified to be something else, aka
leave the drop down on the page form as inherit. The other way would
be to hack in something that looks to the settings and pre-populates
the drop down with the appropriately selected layout. I don't know
which is cleaner code if either or more explicit for the user. In my
experience the problem is just remembering to set the layout properly,
so perhaps just pre-populating that is what we want? It might not be
apparent to the content authors if we leave it as inherit since they
usually don't have access to the settings to change it or see what the
default is. Thoughts on that?

I don't know exactly how to create an extension that can override the
core of radiant to check for that setting, but I'm sure it's possible.
I'll dig into it a bit and if anyone else knows exactly how to do this
off the top of their head, or if there is already an extension to
achieve this please let us know!

Thanks,
-Jon


On Thu, Mar 11, 2010 at 10:11 AM, rubybox <voorruby@gmail.com> wrote:
> Okay just for reference,
>
> I seem have tackled this problem with current solution.
> If someone knows a cleaner better way please let me know
> Using a master layout
>
> <r:snippet name="head"/>
> <body>
>
> <div id="wrapper_header">
>    <div id="container_header">
>       <r:snippet name="header"/>
>    </div>
> </div>
>
> <r:unless_url matches="^/$">
>    <div id="wrapper_section">
>        <div id="container_section">
>            <h1><r:title/></h1>
>        </div>
>    </div>
> </r:unless_url>
>
>
>
>
> <r:if_url matches="^/$">
>    <div id="wrapper_content">
>
>        <div id="container_content">
>
>        <div id="intro">
>             <r:content part="body" inherit="true"/>
>        </div>
>         <div id="col1">
>             <r:content part="col1" inherit="true"/>
>         </div>
>         <div id="col2">
>             <r:content part="col2" inherit="true"/>
>         </div>
>         <div id="col3">
>             <r:content part="col3" inherit="true"/>
>         </div>
>         <div id="col4">
>             <r:content part="col4" inherit="true"/>
>         </div>
>
>        </div>
>    </div>
> </r:if_url>
>
> <r:unless_url matches="^/$">
>    <div id="wrapper_content">
>        <div id="container_content">
>            <div id="bodycontent">
>                <r:content part="body" inherit="true"/>
>            </div>
>            <div id="sidebar">
>                <r:snippet name="sidebar"/>
>                <r:content part="sidebar" inherit="true" />
>            </div>
>        </div>
>    </div>
> </r:unless_url>
>
>
>
> <div id="wrapper_footer">
>    <div id="container_footer">
>        <r:snippet name="footer"/>
>    </div>
> </div>
>
> </body>
> </html>
>
>
>
> Also a good time to start,
> Are there any snippet sources of shared snippets and layouts might
> come handy in the future.
>
>
>
>
> On Mar 11, 12:50 pm, rubybox <voorr...@gmail.com> wrote:
>> I have a pratical problem building my first Radiant site.
>>
>> Simple structure is
>>
>> - Homepage ( special intro layout with 1 col on top and 4 below )
>> - Services  ( 2 col layout )
>> - Contact    (2 col layout )
>>
>> Created 2 layouts named "frontpage" and "normal"
>>
>> If I set in Radiant the layout for Home to "frontpage"
>> I have to manually add the "normal" layout for each childpage below
>> the homepage,
>> very unhandy. I only want to make an exception for the frontpage.
>>
>> This is a common problem with designing a page where the frontpage has
>> a distinct different layout then the childpages below the home one.
>>
>> Is there some workaround to set the layout that is being used on the
>> frontpage with some code?
>> That way I could just leave the Home with layout normal in Radiant,
>> but Radiant would in that case bypass this setting and force the
>> "frontpage" layout upon the homepage.
>>
>> Hope I make this problem clear like this :P
>> Anyone knows a solution?
>
> --
> Radiant CMS Dev Mailing List
> Post:        radiantcms-dev@googlegroups.com
> Unsubscribe: radiantcms-dev-unsubscribe@googlegroups.com
> Group Site:  http://groups.google.com/group/radiantcms-dev/

--
Radiant CMS Dev Mailing List
Post: radiantcms-dev@googlegroups.com
Unsubscribe: radiantcms-dev-unsubscribe@googlegroups.com
Group Site: http://groups.google.com/group/radiantcms-dev/

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive