Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Using several export templates for blog export (Read 3256 times)
Jack Baty
Full Member
*
Offline



Posts: 96

Using several export templates for blog export
Jul 27th, 2013, 10:51am
 
My Tinderbox-based blog has 2 different types of posts, "book" and "post". I would like each to render differently. For example, the book type has an image and ISBN attribute that I want included in the output.

How do I render each item using different templates that works both when calling Children() and when its individual document is exported? If the HTMLExportTemplate is a full HTML page, it shouldn't be used with Children() but if the HTMLExportTemplate is only the note's contents, the individual pages aren't complete HTML pages.

What I thought I could do is use a variable in the template parameter of Children(), something like Children(/Template/^value($PostType)^) but that doesn't seem to be how it works.

I must be approaching this wrong.

Back to top
 
 
  IP Logged
Jack Baty
Full Member
*
Offline



Posts: 96

Re: Using several export templates for blog export
Reply #1 - Jul 27th, 2013, 2:51pm
 
For now I've just moved the logic into the "post" template. This works, but I'd still like to find a way of having individual templates representing each post type but that felt like I was swimming upstream.

Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Using several export templates for blog export
Reply #2 - Jul 28th, 2013, 10:04am
 
I think exporting

   ^children(^value($PostType))

might get work.

For modest changes, I prefer to embed the variation in the post template.  For example:

CSS styles:

   <h1 class="^value($PostClass)"> ... </h1>


Adding supplementary information:

   ^if(^value($PostClass="book"))
         <h2 class="author">^value($Author)</h2>
   ^endif



Back to top
 
 
WWW   IP Logged
Jack Baty
Full Member
*
Offline



Posts: 96

Re: Using several export templates for blog export
Reply #3 - Jul 28th, 2013, 10:47am
 
Thanks Mark, that's how I handled it. There's always a way!
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print