getting the most out of radiant
TRANSCRIPT
Getting the mostout of Radiant
‘cause I had to come up with a title there and then
Hi!
• 26/m/Ghent
• Co-owner of Gorilla webdesign
• github.com/jomz
• twitter.com/jomz
• hardcoreforkingaction.com
Agenda
• Radiant?
• 5 free tips we had to learn by experience
• Where Radiant is going
“Radiant is a no-fluff,open source
content management system designed for small teams”
Simple admin interface
Pages have page parts
Snippets can holdre-used markup
Layouts and Radius put everything together
Bring your own meat
• navigation_tags
• nested_layouts
• mailer
• paperclipped
• locked_page_parts
• future_publishing
• wym_editor
• index_page
• trike_tags
• ...
Bring your own meat
• navigation_tags
• nested_layouts
• mailer
• paperclipped
• locked_page_parts
• future_publishing
• wym_editor
• index_page
• trike_tags
• ...
Bring your own meat
• navigation_tags
• nested_layouts
• mailer
• paperclipped
• locked_page_parts
• future_publishing
• wym_editor
• index_page
• trike_tags
• ...
Bring your own meat
• navigation_tags
• nested_layouts
• mailer
• paperclipped
• locked_page_parts
• future_publishing
• wym_editor
• index_page
• trike_tags
• ...
Bring your own meat
• navigation_tags
• nested_layouts
• mailer
• paperclipped
• locked_page_parts
• future_publishing
• wym_editor
• index_page
• trike_tags
• ...
Bring your own meat
• navigation_tags
• nested_layouts
• mailer
• paperclipped
• locked_page_parts
• future_publishing
• wym_editor
• index_page
• trike_tags
• ...
Free tip #1:Use nested layouts and part inheriting
inside your ‘master’ layout:<div id="content" class="clearfix"> <r:content_for_layout/></div>
“1-col” layout:<r:inside_layout name="master"> <div id="content_main"> <r:content /> </div></r:inside_layout>
“2-col” layout:<r:inside_layout name="master"> <div id="content_main"> <r:content part="body" /> </div> <div id="content_sec"> <r:content part="nav_sec" /> <r:content part="content_sec" /> </div></r:inside_layout>
<div id="content"> <r:if_content part="breadcrumb" inherit="true"> <div id="breadcrumb"> <r:content part="breadcrumb" inherit="true" /> </div> </r:if_content> <div id="content_main"> <r:content part="pre-body" inherit="true" /> <r:unless_content part="read-more"> <r:content /> </r:unless_content> <r:content part="read-more" /> <r:content part="post-body" inherit="true" /> </div> <r:if_content part="nav-sec, content-sec" inherit="true" find="any"> <div id="content_sec"> <r:content part="nav-sec" inherit="true" /> <r:content part="content-sec" inherit="true" /> </div> </r:if_content></div>
<div id="content"> <r:if_content part="breadcrumb" inherit="true"> <div id="breadcrumb"> <r:content part="breadcrumb" inherit="true" /> </div> </r:if_content> <div id="content_main"> <r:content part="pre-body" inherit="true" /> <r:unless_content part="read-more"> <r:content /> </r:unless_content> <r:content part="read-more" /> <r:content part="post-body" inherit="true" /> </div> <r:if_content part="nav-sec, content-sec" inherit="true" find="any"> <div id="content_sec"> <r:content part="nav-sec" inherit="true" /> <r:content part="content-sec" inherit="true" /> </div> </r:if_content></div>
Free tip #2:Keep radius tags away from your (dumb) clients
Free tip #3:Use fragment caching for larger sites
Free tip #4:Keep your radius tidy
<a href="<r:url />"><r:title /></a> and<a href="<r:url />" class="foo">To another page</a>
could be written as
<r:link /> and<r:link class="foo">To another page</r:link>
<r:parent><r:url /></r:parent>
could be written as
<r:parent:url />
<ul><r:children:each><r:unless_url matches="foo"> ...</r:unless_url></r:children:each></ul>
could be written as
<ul><r:children:each:unless_url matches="foo"> ...</r:children:each:unless_url></ul>
<r:parent> <r:assets:each limit="1"> <r:link /> </r:assets:each></r:parent>
could be written as
<r:parent:assets:first:link />
Free tip #5:Snippets can “yield”
make_popup snippet:<div class="popup_box"> <a class="close_popup_link">x</a> <r:yield/></div>
call with a double tag:<r:snippet name="make_popup"> Content for my snippet</r:snippet>
A real life example
If you do need towrite an extension
• Use shared_layouts extension so you don’t have to use (and maintain) a rails layout
• Freeze radiant so that you can see what you are doing ( )
• Let your backend controller inherit from Admin::ResourceController for freeCRUD actions and flash messages
• Upload to github to receive free updates
What’s happening in Radiant world?
Radiant extensions can now be gems!
• Gems have a nice dependency system
• One ‘gem update’ can bring several Radiant instances up to date
Radiant 0.9 coming up!
• Brand new interface with reworked tabs
• Internationalisation (for the backend)
• On Rails 2.3.5, working on Rails 3
Radiant extensions may soon be engines!
• Spree (e-commerce platform) has an extension system based on that of Radiant
• Radiant and Spree communities are looking into a joint effort to bring extensions to the next level (engines or something like it)
some Github profilesto keep an eye on
• github.com/radiant
• github.com/saturnflyer
• github.com/kbingman
• github.com/spanner
• github.com/jgarber
• github.com/johnmuhl
Questions?