github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

freelancing-god / radiant-layout-layer

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 3
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Automatically create Radiant layouts based on HTML files in other extensions — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Adding rake task 
freelancing-god (author)
Mon May 18 13:05:11 -0700 2009
commit  e09bab25dbca2a8aabecbe0b3cae89725dce922f
tree    0282b689580eed3e672e5b05d8af92c005c2ba40
parent  96267d493f3dd06a3f11ac9fd7dcf56387207143
radiant-layout-layer /
name age
history
message
file LICENCE Loading commit data...
file README.textile
file layout_layer_extension.rb
directory lib/
README.textile

Layout Layer

This extension only does one job, but it does it well: Automatically creates layouts and snippets based on HTML files in other extensions.

Why?

The reason boils down to the following:

  • I don’t like writing layouts within a browser
  • My layouts are tied to extensions

So: Any HTML files within an extension’s layouts folder (which is not part of the default extension generation) will get replicated to a Layout object within the Radiant application. If it is nested within folders, then the name becomes a Ruby-like indication of this (eg: directory/file.html becomes a layout named Directory::File). Here’s a rough example:

- vendor/extensions/site_core
- vendor/extensions/site_core/layouts
- vendor/extensions/site_core/layouts/article.html
- vendor/extensions/site_core/layouts/home.html
- vendor/extensions/site_core/layouts/forums.html
- vendor/extensions/site_core/layouts/forums/topic.html
- vendor/extensions/site_core/layouts/forums/topics.html

These layouts get regenerated every time the Rails environment is reloaded. On production systems, this happens when you restart the web server (for example: Mongrel). In development systems, it happens every time you load a page. You should never need to do anything beyond edit the files to see the changes reflected as your developing your intricate CMS.

All the above applies to Snippets as well.

Who is Responsible?

This extension was written in under an hour by Pat Allan – that’s not meant as a boast, just an indication of how small it is. If you have questions, comments, suggestions, criticisms and/or patches, you can either email pat at freelancing-gods dot com, hassle him on Twitter, or send a message via GitHub.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server