On Fri, 5 Oct 2007 10:37:15 +0200, "Aitor Garay-Romero" <[EMAIL PROTECTED]> 
said:
>    With the backdoor extension (http://backdoor.rubyforge.org/) you can
>    do
> something in the line of:
> 
> <r:erb>
>   <% Dir.glob( "newsletters/*.pdf") do |file|
>      if file =~ /.../
>    %>
>       <a href="<%= file%> ... </a>
>   <% end %>
> </r:erb>

Thanks, I got this to work. For the record, here is what I ended up with
(you were missing a second closing "end"):

<h2>Archive:</h2>
<r:erb>
  <% year = 0
     Dir.glob( "healthyconnpdfs/*.pdf").sort().reverse().each do |file|
     if file =~ /healthyconnex-(\d+)-(\d+)-(\w+)\.pdf/
   %>
     <%= year == $1 ? '' : "<h3>#{$1}</h3>" %>
     <a href="<%= file%>"><%= Time.gm($1, $2).strftime("%B")%> </a> 
(<%=$3%>)<br/>
     <% year = $1 %>
  <% end end %>
</r:erb>

-mda
_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to