Loren,

It sounds like you're tackling a hard problem.  I also had to tackle some hard conceptual problems when figuring out how to do the Commentable.  It will be rewarding, I promise!  In doing so, I learned a lot about what makes Radiant tick, even though I already understood Rails.

1) Virtual pages are not directly navigable, but fill some system-specific function for the site.  The Archive Month behavior, is a virtual page that generates archive pages on a month basis, but each of those individual pages is not a real page, just generated by the behavior.  So for your "events", you wouldn't want individual months or days or weeks to be pages, but a virtual page that would show the events for each year/month/day/week dynamically.

2) From the looks of this, yes you want a virtual page.  But perhaps you want the technique that the Archive behavior uses, in that it adjusts the children URLs. Or are there no children at all?

3) Every behavior is uncharted behavior until you've done it!  In retrospect, I would have done a lot of things with Commentable differently, but it works and is quite clever in some respects.  It's commendable that you are taking Radiant with you... it's the harder path.

Sean Cribbs
seancribbs.com

On 10/30/06, Loren Johnson <[EMAIL PROTECTED] > wrote:

I'm now 3 days into pulling my hair out trying to get a custom calendar/events behavior to do what I need it to.

Two questions:

1.  I can't seem to deduce from the code the purpose of page.virtual (or page_virtual within the behavior context). How is it used? How might the use of it help me in creating a behavior which generates it's own, well, virtual pages  a little like the Archive Behavior. 


2. I'm overriding find_page_by_url and taking all the paths above the page with the behavior as parameters to that behavior then outputting the page again... so my find_page_by_url looks simply like this in the behavior:

  def find_page_by_url(url, live = true, clean = false)
    @page
  end

Having went around the routes and everything else in this manner I'm not surprised that my <r:navigation tag no longer indicates a here or selected on these link even though the url's are a match... Is there a way to trick Radiant back into seeing my "virtual pages" as real pages in the proper context so that, well, I can use <r:navigation, among things?  


3. Am I thinking of this all wrong? I've studied the search and the archive behaviors to get this far but I'm going into uncharted area.  What I'm doing currently feels like a bit of a hack but I got here by trying to take Radiant with me instead of diving straight into the routes.rb and doing everything (including managing a separate set of layouts) in another app.... Maybe I should have just done that?


Any help is greatly appreciated. I've really struggled with this and have to release it tomorrow. I never did feel like I found just the right implementation.   

However, when I am done I will attempt to clean it up a bit, refactor as necessary and offer it to anyone here who might have use for an iCal subscription based event calendar/tags for Radiant.   

Thanks,

Loren Johnson


_______________________________________________
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