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
on 2008-12-03 22:34
on 2008-12-04 00:21
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: <div class="press-release"> <p class="contact"><r:content part="Contact information" /></p> <p><strong><r:date format="%d %m %Y"/>, <r:content part="Location" /></strong> - <r:content part="Short description" /></p> <r:content part="Long description" /> <r:snippet name="corporate-press-release-blurb" /> </div> 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.
on 2008-12-04 17:38
On Wed, Dec 3, 2008 at 4:20 PM, Sean C. <email@example.com> 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
on 2008-12-04 18:49
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
on 2008-12-04 19:01
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
on 2008-12-04 19:29
On Thu, Dec 4, 2008 at 11:00 AM, Adam van den Hoven < firstname.lastname@example.org> 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
on 2008-12-04 20:09
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
on 2008-12-04 21:30
On Thu, Dec 4, 2008 at 12:08 PM, Sean C. <email@example.com> 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
on 2008-12-10 00:01
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.
on 2008-12-10 03:12
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?