Turns out I was just misunderstanding the way virtual pages work in the archive extension worked. Since the URL being generated by Radiant (for a monthly archive) is actually something like "/blog/2008/09/27/ monthly-archives/" and not "/blog/2008/09/" as is shown in the address the regexp to match individual posts obviously should match.

On 2008/09/28, at 14:05, Sean Cribbs wrote:

I would test them against plain strings in your irb as well to see if they still match. Here's what I got:

>> "/blog/2008/09/10/some-post" =~ %r{blog/..../../../.*$}
=> 1
>> "/blog/2008/09/10/" =~ %r{blog/..../../../.*$}
=> 1
>> "/blog/2008/09/" =~ %r{blog/..../../../.*$}
=> nil
>>

If you're having problems with the "." meta-character, why not do something like:

"blog/\d{4}/\d{2}/\d{2}/.*$"

Sean

john wrote:
This may not be anything directly related to Radiant but it seems pretty weird so I thought I better ask the experts. I have the following in a layout

<r:if_url matches="blog/..../../../.*$"><r:title /></r:if_url>

As far as I can tell this should match on the individual posts, which it does but the weird part is that it also matches for any monthly archive pages with a URL like "blog/2008/09/". I've even tried

<r:if_url matches="blog/..../../../.*$">
<r:unless_url matches="blog/..../../$">
<r:title />
<r:unless_url>
</r:if_url>

but it still matches the monthly archive pages. From the looks of it I am going to have to have 2 layouts that are exactly the same with the exception of that one line with the regexp which doesn't seem optimal.

Anyone see what I'm missing here or someway to match on the individual posts but not on the monthly archives?

I tested the regexps in Reggy and they behave exactly as I'd expect, but once they are in Radiant they start making full matches where they shouldn't be.

thanks.
_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to