Bill,

I've written a Event Calendar extension which pulls events from an  
ical subscription and populates them into calendars which each have  
an associated "category" and "slug". I then access the different  
calendars through a virtual page root node like this: http:// 
yoursite.com/calendar/category/slug (or more concretely http:// 
yoursite.com/main/youth).

This is very similar to how the ArchivePage behavior in the core code  
works. Take a look at that if you haven't already.

I'm releasing a tidied-up version of this EventCalendar extension  
here on the list within a day or two so you can use it as another  
example then... Actually though, pretty much everything you need is  
here between the EventCalendar page type which overrides find_by_url  
to, essentially shutting-down further Radiant processing of child  
pages, and the <r:calendar... tag which processes the query path  
parameters:

class EventCalendar < Page

   LOGGER = ActionController::Base.logger

   description %{ Create a series of calendar pages. }

   def cache?
     false
   end

   def virtual?
     true
   end

   def find_by_url(url, live = true, clean = false)
     self
   end

end

AND

tag "calendar" do |tag|
   event_search = EventSearch.new
   event_search.category = tag.attr['category'] ||  
(@request.parameters[:url][1] if self.class == EventCalendar) ||  
"master"
   event_search.slugs = tag.attr['slugs'] || (@request.path_parameters 
[:url][2] if self.class == EventCalendar) || "all"
   event_search.period.name = tag.attr['period'] ||  
(@request.path_parameters[:url][3] if self.class == EventCalendar) ||  
"month"
    # ... note the @request.parameters[:url][1] and [2] references
end

Hope that helps,

Loren Johnson
www.hellovenado.com


On May 25, 2007, at 12:14 AM, Bill Rowell wrote:

> I'm developing another radiant extension that I basically want to  
> be able to
> display a catalog of categories, sub-categories, and items with.  I  
> don't
> want to have to create a page for every one of those, I want it to be
> dynamic based on what someone can set up through an admin  
> interface.  I also
> don't want to lose the power of radiant and its tagging system  
> (like not
> being able to use r:title, r:snippet, r:content etc. etc.) by  
> having the
> extension be its own application outside of the CMS.  Another  
> requirement is
> the ability to have pretty urls like /catalog/department/shoes/  
> instead of
> having query string variables muddying things up.
>
> Has anyone tried to do something like this and had some success  
> that they
> could share?  I've given this a bit of thought and haven't really  
> come up
> with a solution I like.
> _______________________________________________
> Radiant mailing list
> Post:   [email protected]
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

_______________________________________________
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