elfuchsjekyll / vosao

Automatically exported from code.google.com/p/vosao
0 stars 0 forks source link

Add context variables to structure template rendering. #140

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
One thing I am wondering (probably the first of many) is whether I can
access the page context in velocity structure templates.  I see that
the structured content data values are pushed through in the "content"
context, but was hoping I could have access to the page context also
so I could do things such as display snippets for all of the child
pages when I used a particular structured template.

The content of my structured template is as follows:

<div id="content" class="span-10">
$content.maintext
#foreach($p in $service.findPageChildren($page.friendlyURL))

 <h3>$p.title</h3>
 <p>$service.findContent($p.friendlyURL)</p>

#end
</div>
<div id="sidebar" class="span-14 last">
       <div class="photoborder">
               <!-- image dimensions need to be 460 x 305 -->
               <img src="$content.image" alt="$content.image_alttext" />
       </div>
</div>

Any guidance as to how I might achieve what I am trying here would be
great.

Thanks,
Damon.

Original issue reported on code.google.com by kinyelo@gmail.com on 2 Mar 2010 at 11:13

GoogleCodeExporter commented 9 years ago
Implemented.

Original comment by kinyelo@gmail.com on 2 Mar 2010 at 11:28