# Templates extension documentation?

**URL:** <https://www.ruby-forum.com/t/templates-extension-documentation/154781>\
**Category:** Radiant CMS\
**Created:** [December 3, 2008, 9:34pm UTC](https://www.ruby-forum.com/t/templates-extension-documentation/154781 "2008-12-03T21:34:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nateless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@nateless](https://www.ruby-forum.com/u/nateless)\
**Post date:** [December 3, 2008, 9:34pm UTC](https://www.ruby-forum.com/t/templates-extension-documentation/154781/1 "2008-12-03T21:34:41Z")

</div>

Is there a tutorial or some sort of example of how the templates  
extension  
works in practice? There is some info in the readme but there aren’t any  
examples of how it works. It looks like a way to create a page that is  
simply a collection of snippets.

What I thought it was is a way to have nested partials, but that doesn’t  
seem to be the case.

~Nate

---

<div class="post-metadata">

**Author:** ![nateless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@nateless](https://www.ruby-forum.com/u/nateless)\
**Post date:** [December 3, 2008, 11:21pm UTC](https://www.ruby-forum.com/t/templates-extension-documentation/154781/2 "2008-12-03T23:21:05Z")

</div>

Templates does four things:

1. Provides a customized interface to the page editor
2. Restricts what page-parts may appear on a page of that type
3. Hides and consolidates design aspects about how parts of the page  
will be rendered
4. Auto-selects/restricts the page-class (Archive, File Not Found, etc).

For example, let’s say I have a template for press releases. Press  
releases consist of a short description (that also serves as the first  
paragraph), a longer description, a location, contact information, and  
standard info about the company. So I might set up a template like so:

Location: One-line  
Short description: One-line  
Long description: Plain textarea [Textile]  
Contact information: Plain textarea

Then I would set the structure (which becomes the ‘body’ page-part) to  
be something like:

**,** -

This allows my Layout to serve as a wireframe for the whole site, with  
many different page designs filling the “content well”. I would only  
need a single \<r:content /\> tag within the layout to accomplish this.

Does this answer your question?

Sean

p.s. Digital Pulp (Josh, Justin & friends) prefer to call them  
content-types and thus renamed them as such in their internal version of  
this extension.

---

<div class="post-metadata">

**Author:** ![nateless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@nateless](https://www.ruby-forum.com/u/nateless)\
**Post date:** [December 4, 2008, 4:38pm UTC](https://www.ruby-forum.com/t/templates-extension-documentation/154781/3 "2008-12-04T16:38:16Z")

</div>

On Wed, Dec 3, 2008 at 4:20 PM, Sean C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> This allows my Layout to serve as a wireframe for the whole site, with many  
> different page designs filling the “content well”. I would only need a  
> single \<r:content /\> tag within the layout to accomplish this.
> 
> Does this answer your question?

Thanks for the description, Sean. This does clear it up for me.  
Something I  
was also having trouble with is that the parts I was creating in my  
template  
were defaulting to the “Boolean” type. That prevented me from getting  
any  
kind of text field in the pages based on that template. Once I changed  
them  
to plaintext, and read your description, then I grokked how it worked.

Another question, is there any way, outside of modifying the extension  
itself, to get the plaintext boxes to be wider than about 100px? It’s  
not a  
huge problem because I edit form text with It’s All Text and TextMate,  
but I  
thought I would ask.

Great extension, now I know how it works. You might want to put that  
content  
in the readme.

Thanks,

~Nate

---

<div class="post-metadata">

**Author:** ![nateless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@nateless](https://www.ruby-forum.com/u/nateless)\
**Post date:** [December 4, 2008, 5:49pm UTC](https://www.ruby-forum.com/t/templates-extension-documentation/154781/4 "2008-12-04T17:49:18Z")

</div>

Also, Sean, there is one small problem with the Templates extension:  
there  
doesn’t seem to be a way to change the page status from draft to  
published.  
I set my pages to published in the db, but that will get awfully tedious  
in  
short order. Is there any other way to set a page’s status to published  
without setting it in the admin page view? It would be tremendous if  
that  
was possible in the page list in the admin side (wink, wink).

Thanks,

~Nate

---

<div class="post-metadata">

**Author:** ![nateless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@nateless](https://www.ruby-forum.com/u/nateless)\
**Post date:** [December 4, 2008, 6:01pm UTC](https://www.ruby-forum.com/t/templates-extension-documentation/154781/5 "2008-12-04T18:01:05Z")

</div>

Nate,

It seems to me that what is missing is a blow by blood dripping, gut  
wrenching, soul ripping blow account (was that over the top?) of how  
to get something going with Templates. You should be writing down your  
experiences to share with the rest of us. I’m sure the Radiant Wiki  
has room for such a thing.

Adam

---

<div class="post-metadata">

**Author:** ![nateless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@nateless](https://www.ruby-forum.com/u/nateless)\
**Post date:** [December 4, 2008, 6:29pm UTC](https://www.ruby-forum.com/t/templates-extension-documentation/154781/6 "2008-12-04T18:29:18Z")

</div>

On Thu, Dec 4, 2008 at 11:00 AM, Adam van den Hoven \<  
removed\_email\_address@domain.invalid\> wrote:

> Nate,
> 
> It seems to me that what is missing is a blow by blood dripping, gut  
> wrenching, soul ripping blow account (was that over the top?) of how to get  
> something going with Templates. You should be writing down your experiences  
> to share with the rest of us. I’m sure the Radiant Wiki has room for such a  
> thing.

Once I get a full handle on it, I’ll do that. It’s a very handy  
extension. I  
have never like the idea of switching page layouts to have a different  
footer or add sidebar. Maintaining parity on nav bars and header, etc.  
is  
such a pain. I’ll keep everyone abreast of my experiences with it.

~Nate

---

<div class="post-metadata">

**Author:** ![nateless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@nateless](https://www.ruby-forum.com/u/nateless)\
**Post date:** [December 4, 2008, 8:30pm UTC](https://www.ruby-forum.com/t/templates-extension-documentation/154781/7 "2008-12-04T20:30:19Z")

</div>

On Thu, Dec 4, 2008 at 12:08 PM, Sean C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Of course, that should be possible. In both the projects I’ve used  
> templates on, they had some other extension that handled this. Patches are  
> welcome :).

Of course. After the new year my projects will be ramping down. I’ll try  
and  
contribute more then. Right now I can use the Copy/Move extension to  
change  
page status until then.

~Nate

---

<div class="post-metadata">

**Author:** ![nateless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@nateless](https://www.ruby-forum.com/u/nateless)\
**Post date:** [December 4, 2008, 7:09pm UTC](https://www.ruby-forum.com/t/templates-extension-documentation/154781/8 "2008-12-04T19:09:14Z")

</div>

Of course, that should be possible. In both the projects I’ve used  
templates on, they had some other extension that handled this. Patches  
are welcome :).

Sean

---

<div class="post-metadata">

**Author:** ![nateless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@nateless](https://www.ruby-forum.com/u/nateless)\
**Post date:** [December 10, 2008, 2:12am UTC](https://www.ruby-forum.com/t/templates-extension-documentation/154781/9 "2008-12-10T02:12:51Z")

</div>

Sean C. wrote:

> Of course, that should be possible. In both the projects I’ve used  
> templates on, they had some other extension that handled this. Patches  
> are welcome :).
> 
> Sean

What “other” extension would that be?

---

<div class="post-metadata">

**Author:** ![nateless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@nateless](https://www.ruby-forum.com/u/nateless)\
**Post date:** [December 9, 2008, 11:01pm UTC](https://www.ruby-forum.com/t/templates-extension-documentation/154781/10 "2008-12-09T23:01:05Z")

</div>

I think the page form controls could be a little prettier and little  
more thought out design-wise. I will definitely be contributing to this  
extension.
