# An Informal Contest

**URL:** <https://www.ruby-forum.com/t/an-informal-contest/62996>\
**Category:** Radiant CMS\
**Created:** [June 10, 2006, 8:51am UTC](https://www.ruby-forum.com/t/an-informal-contest/62996 "2006-06-10T08:51:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_WSLong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@John\_WSLong](https://www.ruby-forum.com/u/John_WSLong)\
**Post date:** [June 10, 2006, 8:51am UTC](https://www.ruby-forum.com/t/an-informal-contest/62996/1 "2006-06-10T08:51:00Z")

</div>

Changeset 57 contains the following improvements:

- Updated db/setup.rb. Option parsing has been improved and you can  
now  
select a template for your new Radiant database.
- Added an export controller to make it easier to create templates. It  
exports your database in YAML format. Simply hit /admin/export/.

[http://dev.radiantcms.org/radiant/changeset/57](http://dev.radiantcms.org/radiant/changeset/57)

If you examine the db/templates directory now you will see a couple of  
simple YAML templates which can be used to generate the initial database  
for a Radiant install. I’ve included three default templates:

1. An empty template (to create a blank database)
2. A bare bones template (the same as what you have seen before)
3. A styled blog template

I just finished coding option #3 today. It demonstrates a lot of the  
advanced features of Radiant and also looks nice.

I would love to see more options for people just getting started with  
Radiant. If you are a talented designer and I’d like to invite you to  
participate in an informal contest of sorts. I’m looking for two basic  
templates:

- A blog template
- A simple company web site template

Here’s the catch: you can’t use images in the design at all. (Since  
Radiant doesn’t have the attachments system yet it wouldn’t make sense  
to put a lot of additional images in the public/images directory.)

If you submit a template that I like it will have a shot at being  
included in the core distribution.

The easiest way to create a template is to setup a Radiant database the  
way you like it and then go to /admin/export/ to get the YAML for it.  
Then take the YAML and paste it into a template file in the db/templates  
directory. You will need to modify the generated YAML a bit, but it  
should be enough to get you started.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![John\_WSLong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@John\_WSLong](https://www.ruby-forum.com/u/John_WSLong)\
**Post date:** [June 30, 2006, 7:01am UTC](https://www.ruby-forum.com/t/an-informal-contest/62996/2 "2006-06-30T07:01:15Z")

</div>

> The easiest way to create a template is to setup a Radiant database the  
> way you like it and then go to /admin/export/ to get the YAML for it.  
> Then take the YAML and paste it into a template file in the db/templates  
> directory. You will need to modify the generated YAML a bit, but it  
> should be enough to get you started.

I’ve just finished a template, and now I am having one hell of a [not]  
good time trying to get the it to work. I was wondering, why not just  
use sql dumps for templates?

---

<div class="post-metadata">

**Author:** ![John\_WSLong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@John\_WSLong](https://www.ruby-forum.com/u/John_WSLong)\
**Post date:** [June 30, 2006, 9:11am UTC](https://www.ruby-forum.com/t/an-informal-contest/62996/3 "2006-06-30T09:11:58Z")

</div>

Scratch that question, and answered it for myself.

---

<div class="post-metadata">

**Author:** ![John\_WSLong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@John\_WSLong](https://www.ruby-forum.com/u/John_WSLong)\
**Post date:** [June 30, 2006, 10:16pm UTC](https://www.ruby-forum.com/t/an-informal-contest/62996/4 "2006-06-30T22:16:16Z")

</div>

John W. Long wrote:

> Bernard Yu wrote:
> 
> > Scratch that question, and answered it for myself.
> 
> What was the answer? 🙂
> 
> –  
> John L.  
> [http://wiseheartdesign.com](http://wiseheartdesign.com)

It’d be trouble for anyone trying to use a non-SQL database. Though I  
suppose that wouldn’t really happen that often.

But for the .yml files, I’m having a hell of a time trying to get the  
thing to work properly and I haven’t the foggiest clue why. As it is,  
I’m finishing with fixing some problems I didn’t notice with the CSS  
print file, and I’m not looking foward to going through and making it  
pretty again. it keeps coming up with yaml.rb errors every other line.

---

<div class="post-metadata">

**Author:** ![John\_WSLong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@John\_WSLong](https://www.ruby-forum.com/u/John_WSLong)\
**Post date:** [July 1, 2006, 4:07am UTC](https://www.ruby-forum.com/t/an-informal-contest/62996/5 "2006-07-01T04:07:02Z")

</div>

If you make it work, it would be nice if you can post your experience, I  
haven’t been trying lately but I couldn’t get a template to work  
neither.

---

<div class="post-metadata">

**Author:** ![John\_WSLong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@John\_WSLong](https://www.ruby-forum.com/u/John_WSLong)\
**Post date:** [June 30, 2006, 3:15pm UTC](https://www.ruby-forum.com/t/an-informal-contest/62996/6 "2006-06-30T15:15:22Z")

</div>

Bernard Yu wrote:

> Scratch that question, and answered it for myself.

What was the answer? 🙂

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![John\_WSLong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@John\_WSLong](https://www.ruby-forum.com/u/John_WSLong)\
**Post date:** [July 3, 2006, 12:18am UTC](https://www.ruby-forum.com/t/an-informal-contest/62996/7 "2006-07-03T00:18:26Z")

</div>

Well then, I’d like to submit a (company) website template of sorts for  
the contest…  
I present [Handsome in  
Blue](http://radtest.enguindesign.com).  
It’s not just a blank template, it’s a lesson of sorts as well for those  
new to Radiant as well as managing websites. The [template](http://enguindesign.com/sites/radiant-template/handsomeinblue.yml)  
is a heavy weighing in at 41k, but it has separate stylesheets for  
screen, print, and handheld devices, (also has some goodies for text  
browsers). It uses XHTML-Strict, the CSS validates beautifully, and  
takes advantage of a lot of Radius’s features.

* * *

Excuse me while I sob like a little baby I figured it out…the hard  
way. I got to thinking, this is Ruby…therefore spaces matter. With  
that in mind, I’ll outline the structure of the yaml file.

## name: [name of template] description: [description for template] records: Layouts: 1: name: [name of layout] id: 1 content: | This is where the body of your template goes the white space must be at least one space beyond the beginning of its container, and remember no indents that’s cheating. 2: name: [name of second layout] id: 2 Content: | Snippets: 1: name: [you get the point] id: 1 content: | … Pages: 1: slug: title: breadcrumb: id: status\_id: layout\_id: [id of layout that should apply to it] parent\_id: [id of parent] PageParts: 1: name: page\_id: [id of page this part applies to] id: 1 content: | I hate myself, a lot

You basically have to give the same level container the same ammount of  
white-space (so “layouts,” “Snippets,” “Pages,” and “PageParts” all have  
2spaces, the ID numbers all have 4 spaces, etc). Hopefully I explained  
that well enough…once you figure it out, it’s really easy. Good luck!
