[Radiant] Dynamic Attributes in a Snippet Tag?

Loren Johnson loren at fn-group.com
Fri Oct 27 16:41:31 CDT 2006


Sean and Mislav thanks for the responses --

For what it's worth, below is the use case for dynamic attributes in  
Snippets.  There are things that I'd like to see added to a Radiant  
release more and before than this without question (page reordering  
and reparenting please), but at least here is a use case for the  
record of what I think could be an easy, useful and possibly in-scope  
extension to Snippets.

An Article Summary Template

I work with a designer for most everything I do. His HTML/CSS skills  
are poor. We are just finishing-up a site (http:// 
diopa.grimedesign.com) and in that site on several pages we pull-in  
the summary part of an article and attached a nice little header  
which spits out the name of the Section and the date the Article was  
posted before the title. This summary pattern repeats many times and  
is always the same except that we like to customized the link text  
which goes to the full article. Everything else is dynamic.

So I say to Paul, no problem I'll just through that little set of  
tags into a snippet such that he can do a

<r:find url="/news/ecs/article">
  <r:snippet name="summary" linkText="Read more about this on ECS  
News" />
</r:find>

This means that he doesn't have to copy and paste a format for this  
summary over and over as he populates the site with content. It also  
of course means we don't have to change it in all those spots if we  
want to change something global outside the scope of the CSS in this  
summary format.

We had considered using another page part called "linkText' to  
accomplish the same end, however we have situations where the same  
article is posted in multiple places on the site in different  
contexts and the link text changes accordingly.

Without any of these options working we're left with the acceptable,  
though less than preferable solution of:

<r:find url="/news/ecs/article/" >
<div class="articleSummary">
     <r:snippet name="ArticleSummary" />
     <r:link class="more">Read more about this on ECS News...</r:link>
</div>
</r:find>

Cheers,

Loren Johnson
loren at fn-group.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.radiantcms.org/pipermail/radiant/attachments/20061027/56defb7b/attachment.html


More information about the Radiant mailing list