Re: [Radiant] Re: show upcoming events
Good catch, thanks. A fix has been pushed. On Jun 21, 2010, at 5:48 PM, Matt Spendlove wrote: I typo'd the name of my page part in the "for" attribute initially and I got the stack below. Fixing the typo meant the date displayed correctly but I'm guessing you might wanna scope TagError in.
Re: [Radiant] Re: show upcoming events
Hi Josh Thanks very much for looking at this. Seems to have done the trick though I did uncover another potential problem, I typo'd the name of my page part in the "for" attribute initially and I got the stack below. Fixing the typo meant the date displayed correctly but I'm guessing you might wanna scope TagError in.. NameError (uninitialized constant PageParts::PagePartTags::TagError): vendor/extensions/page_parts/lib/page_parts/page_part_tags.rb:152:in `tag:date' vendor/radiant/lib/radiant/taggable.rb:33:in `send' vendor/radiant/lib/radiant/taggable.rb:33:in `render_tag' vendor/radiant/app/models/page_context.rb:10:in `initialize' vendor/radiant/vendor/radius/lib/radius/context.rb:62:in `call' vendor/radiant/vendor/radius/lib/radius/context.rb:62:in `render_tag' vendor/radiant/vendor/radius/lib/radius/context.rb:93:in `stack' vendor/radiant/vendor/radius/lib/radius/context.rb:61:in `render_tag' vendor/radiant/app/models/page_context.rb:18:in `render_tag' vendor/radiant/vendor/radius/lib/radius/parser.rb:50:in `stack_up' vendor/radiant/vendor/radius/lib/radius/parse_tag.rb:12:in `call' vendor/radiant/vendor/radius/lib/radius/parse_tag.rb:12:in `to_s' vendor/radiant/vendor/radius/lib/radius/parser.rb:54:in `stack_up' vendor/radiant/vendor/radius/lib/radius/tag_binding.rb:33:in `call' vendor/radiant/vendor/radius/lib/radius/tag_binding.rb:33:in `expand' vendor/extensions/page_parts/lib/page_parts/page_part_tags.rb:65:in `tag:if_later' Cheers Matt On Mon, Jun 21, 2010 at 9:09 PM, Josh French wrote: > I've pushed a small change, can you update & make sure it's working for you? > > Related question for the list: anyone know how to reliably overwrite an > existing tag description so that the reference is updated? > > On Jun 21, 2010, at 1:14 PM, Matt Spendlove wrote: > >> Sure, thanks. Let me know if you need any info from my setup.. >> >> -- >> http://cenatus.org/ >> http://radialsolutions.co.uk/ >> -- >> >> >> >> On Mon, Jun 21, 2010 at 6:13 PM, Josh French wrote: >>> >>> Looks like Radiant isn't finding the extended r:date definition. I'll >>> take a >>> look and get back to you. >>> >>> j >>> >>> On Jun 21, 2010, at 12:41 PM, Matt Spendlove wrote: >>> Hi Marshall/Josh Thanks for the info. I've installed Page Factory and Page Parts and I agree, very useful functionality. Unfortunately I get an error when I try and output the date held in my start_page part using the tag. I can output the date just fine if I use , obviously the date is then unformatted: StandardTags::TagError (Invalid value for 'for' attribute.): vendor/radiant/app/models/standard_tags.rb:597:in `tag:date' vendor/radiant/lib/radiant/taggable.rb:33:in `send' vendor/radiant/lib/radiant/taggable.rb:33:in `render_tag' vendor/radiant/app/models/page_context.rb:10:in `initialize' vendor/radiant/vendor/radius/lib/radius/context.rb:62:in `call' vendor/radiant/vendor/radius/lib/radius/context.rb:62:in `render_tag' vendor/radiant/vendor/radius/lib/radius/context.rb:93:in `stack' vendor/radiant/vendor/radius/lib/radius/context.rb:61:in `render_tag' vendor/radiant/app/models/page_context.rb:18:in `render_tag' vendor/radiant/vendor/radius/lib/radius/parser.rb:50:in `stack_up' vendor/radiant/vendor/radius/lib/radius/parse_tag.rb:12:in `call' vendor/radiant/vendor/radius/lib/radius/parse_tag.rb:12:in `to_s' vendor/radiant/vendor/radius/lib/radius/parser.rb:54:in `stack_up' vendor/radiant/vendor/radius/lib/radius/tag_binding.rb:33:in `call' vendor/radiant/vendor/radius/lib/radius/tag_binding.rb:33:in `expand' vendor/extensions/page_parts/lib/page_parts/page_part_tags.rb:65:in `tag:if_later' I installed Page Parts with script/extension install and I'm on 0.9RC2. Any ideas out there? Josh? Cheers Matt -- http://cenatus.org/ http://radialsolutions.co.uk/ -- On Sat, Jun 19, 2010 at 8:00 PM, Marshal Linfoot wrote: > > Hi Brian. > > In case you're thinking about using the page_parts extension, I have a > simple example to show how that might work for you. Page_factory and > page_parts are two excellent extensions, by the way -- highly recommend > them. Page_parts comes with some built-in custom parts, in particular > the > datetime part is very useful. > In my site, I use page_parts to define the startdate and enddate of > events. > These are tabs that have a calendar date picker, really convenient when > adding a new event, less error prone than typing the date. The content > of > the startdate and enddate parts can then be used anywhere in your site. >
Re: [Radiant] Re: show upcoming events
On Mon, Jun 21, 2010 at 4:09 PM, Josh French wrote: > I've pushed a small change, can you update & make sure it's working for you? > > Related question for the list: anyone know how to reliably overwrite an > existing tag description so that the reference is updated? I haven't tried it, but a guess would be to override the tag_descriptions on Page in the extension activate method. http://github.com/radiant/radiant/blob/master/lib/radiant/taggable.rb#L46 > > On Jun 21, 2010, at 1:14 PM, Matt Spendlove wrote: > >> Sure, thanks. Let me know if you need any info from my setup.. >> >> -- >> http://cenatus.org/ >> http://radialsolutions.co.uk/ >> -- >> >> >> >> On Mon, Jun 21, 2010 at 6:13 PM, Josh French wrote: >>> >>> Looks like Radiant isn't finding the extended r:date definition. I'll >>> take a >>> look and get back to you. >>> >>> j >>> >>> On Jun 21, 2010, at 12:41 PM, Matt Spendlove wrote: >>> Hi Marshall/Josh Thanks for the info. I've installed Page Factory and Page Parts and I agree, very useful functionality. Unfortunately I get an error when I try and output the date held in my start_page part using the tag. I can output the date just fine if I use , obviously the date is then unformatted: StandardTags::TagError (Invalid value for 'for' attribute.): vendor/radiant/app/models/standard_tags.rb:597:in `tag:date' vendor/radiant/lib/radiant/taggable.rb:33:in `send' vendor/radiant/lib/radiant/taggable.rb:33:in `render_tag' vendor/radiant/app/models/page_context.rb:10:in `initialize' vendor/radiant/vendor/radius/lib/radius/context.rb:62:in `call' vendor/radiant/vendor/radius/lib/radius/context.rb:62:in `render_tag' vendor/radiant/vendor/radius/lib/radius/context.rb:93:in `stack' vendor/radiant/vendor/radius/lib/radius/context.rb:61:in `render_tag' vendor/radiant/app/models/page_context.rb:18:in `render_tag' vendor/radiant/vendor/radius/lib/radius/parser.rb:50:in `stack_up' vendor/radiant/vendor/radius/lib/radius/parse_tag.rb:12:in `call' vendor/radiant/vendor/radius/lib/radius/parse_tag.rb:12:in `to_s' vendor/radiant/vendor/radius/lib/radius/parser.rb:54:in `stack_up' vendor/radiant/vendor/radius/lib/radius/tag_binding.rb:33:in `call' vendor/radiant/vendor/radius/lib/radius/tag_binding.rb:33:in `expand' vendor/extensions/page_parts/lib/page_parts/page_part_tags.rb:65:in `tag:if_later' I installed Page Parts with script/extension install and I'm on 0.9RC2. Any ideas out there? Josh? Cheers Matt -- http://cenatus.org/ http://radialsolutions.co.uk/ -- On Sat, Jun 19, 2010 at 8:00 PM, Marshal Linfoot wrote: > > Hi Brian. > > In case you're thinking about using the page_parts extension, I have a > simple example to show how that might work for you. Page_factory and > page_parts are two excellent extensions, by the way -- highly recommend > them. Page_parts comes with some built-in custom parts, in particular > the > datetime part is very useful. > In my site, I use page_parts to define the startdate and enddate of > events. > These are tabs that have a calendar date picker, really convenient when > adding a new event, less error prone than typing the date. The content > of > the startdate and enddate parts can then be used anywhere in your site. > Let's say from some other page you wanted to list upcoming events. The > code > would look something like this: > > > > > /> > > > > > This assumes your events are ordered by start date. > Hope this helps as a starting place for some ideas. > -- > marshal > >>> >>> > > -- Jim Gay Saturn Flyer LLC http://www.saturnflyer.com 571-403-0338
Re: [Radiant] Re: show upcoming events
I've pushed a small change, can you update & make sure it's working for you? Related question for the list: anyone know how to reliably overwrite an existing tag description so that the reference is updated? On Jun 21, 2010, at 1:14 PM, Matt Spendlove wrote: Sure, thanks. Let me know if you need any info from my setup.. -- http://cenatus.org/ http://radialsolutions.co.uk/ -- On Mon, Jun 21, 2010 at 6:13 PM, Josh French wrote: Looks like Radiant isn't finding the extended r:date definition. I'll take a look and get back to you. j On Jun 21, 2010, at 12:41 PM, Matt Spendlove wrote: Hi Marshall/Josh Thanks for the info. I've installed Page Factory and Page Parts and I agree, very useful functionality. Unfortunately I get an error when I try and output the date held in my start_page part using the tag. I can output the date just fine if I use , obviously the date is then unformatted: StandardTags::TagError (Invalid value for 'for' attribute.): vendor/radiant/app/models/standard_tags.rb:597:in `tag:date' vendor/radiant/lib/radiant/taggable.rb:33:in `send' vendor/radiant/lib/radiant/taggable.rb:33:in `render_tag' vendor/radiant/app/models/page_context.rb:10:in `initialize' vendor/radiant/vendor/radius/lib/radius/context.rb:62:in `call' vendor/radiant/vendor/radius/lib/radius/context.rb:62:in `render_tag' vendor/radiant/vendor/radius/lib/radius/context.rb:93:in `stack' vendor/radiant/vendor/radius/lib/radius/context.rb:61:in `render_tag' vendor/radiant/app/models/page_context.rb:18:in `render_tag' vendor/radiant/vendor/radius/lib/radius/parser.rb:50:in `stack_up' vendor/radiant/vendor/radius/lib/radius/parse_tag.rb:12:in `call' vendor/radiant/vendor/radius/lib/radius/parse_tag.rb:12:in `to_s' vendor/radiant/vendor/radius/lib/radius/parser.rb:54:in `stack_up' vendor/radiant/vendor/radius/lib/radius/tag_binding.rb:33:in `call' vendor/radiant/vendor/radius/lib/radius/tag_binding.rb:33:in `expand' vendor/extensions/page_parts/lib/page_parts/page_part_tags.rb:65:in `tag:if_later' I installed Page Parts with script/extension install and I'm on 0.9RC2. Any ideas out there? Josh? Cheers Matt -- http://cenatus.org/ http://radialsolutions.co.uk/ -- On Sat, Jun 19, 2010 at 8:00 PM, Marshal Linfoot wrote: Hi Brian. In case you're thinking about using the page_parts extension, I have a simple example to show how that might work for you. Page_factory and page_parts are two excellent extensions, by the way -- highly recommend them. Page_parts comes with some built-in custom parts, in particular the datetime part is very useful. In my site, I use page_parts to define the startdate and enddate of events. These are tabs that have a calendar date picker, really convenient when adding a new event, less error prone than typing the date. The content of the startdate and enddate parts can then be used anywhere in your site. Let's say from some other page you wanted to list upcoming events. The code would look something like this: /> This assumes your events are ordered by start date. Hope this helps as a starting place for some ideas. -- marshal
Re: [Radiant] Re: show upcoming events
Sure, thanks. Let me know if you need any info from my setup.. -- http://cenatus.org/ http://radialsolutions.co.uk/ -- On Mon, Jun 21, 2010 at 6:13 PM, Josh French wrote: > Looks like Radiant isn't finding the extended r:date definition. I'll take a > look and get back to you. > > j > > On Jun 21, 2010, at 12:41 PM, Matt Spendlove wrote: > >> Hi Marshall/Josh >> >> Thanks for the info. >> I've installed Page Factory and Page Parts and I agree, very useful >> functionality. >> >> Unfortunately I get an error when I try and output the date held in my >> start_page part using the tag. I can >> output the date just fine if I use , >> obviously the date is then unformatted: >> >> StandardTags::TagError (Invalid value for 'for' attribute.): >> vendor/radiant/app/models/standard_tags.rb:597:in `tag:date' >> vendor/radiant/lib/radiant/taggable.rb:33:in `send' >> vendor/radiant/lib/radiant/taggable.rb:33:in `render_tag' >> vendor/radiant/app/models/page_context.rb:10:in `initialize' >> vendor/radiant/vendor/radius/lib/radius/context.rb:62:in `call' >> vendor/radiant/vendor/radius/lib/radius/context.rb:62:in `render_tag' >> vendor/radiant/vendor/radius/lib/radius/context.rb:93:in `stack' >> vendor/radiant/vendor/radius/lib/radius/context.rb:61:in `render_tag' >> vendor/radiant/app/models/page_context.rb:18:in `render_tag' >> vendor/radiant/vendor/radius/lib/radius/parser.rb:50:in `stack_up' >> vendor/radiant/vendor/radius/lib/radius/parse_tag.rb:12:in `call' >> vendor/radiant/vendor/radius/lib/radius/parse_tag.rb:12:in `to_s' >> vendor/radiant/vendor/radius/lib/radius/parser.rb:54:in `stack_up' >> vendor/radiant/vendor/radius/lib/radius/tag_binding.rb:33:in `call' >> vendor/radiant/vendor/radius/lib/radius/tag_binding.rb:33:in `expand' >> vendor/extensions/page_parts/lib/page_parts/page_part_tags.rb:65:in >> `tag:if_later' >> >> I installed Page Parts with script/extension install and I'm on 0.9RC2. >> Any ideas out there? Josh? >> >> Cheers >> >> Matt >> -- >> http://cenatus.org/ >> http://radialsolutions.co.uk/ >> -- >> >> >> >> On Sat, Jun 19, 2010 at 8:00 PM, Marshal Linfoot >> wrote: >>> >>> Hi Brian. >>> >>> In case you're thinking about using the page_parts extension, I have a >>> simple example to show how that might work for you. Page_factory and >>> page_parts are two excellent extensions, by the way -- highly recommend >>> them. Page_parts comes with some built-in custom parts, in particular the >>> datetime part is very useful. >>> In my site, I use page_parts to define the startdate and enddate of >>> events. >>> These are tabs that have a calendar date picker, really convenient when >>> adding a new event, less error prone than typing the date. The content of >>> the startdate and enddate parts can then be used anywhere in your site. >>> Let's say from some other page you wanted to list upcoming events. The >>> code >>> would look something like this: >>> >>> >>> >>> >>> >> /> >>> >>> >>> >>> >>> This assumes your events are ordered by start date. >>> Hope this helps as a starting place for some ideas. >>> -- >>> marshal >>> > >
Re: [Radiant] Re: show upcoming events
Looks like Radiant isn't finding the extended r:date definition. I'll take a look and get back to you. j On Jun 21, 2010, at 12:41 PM, Matt Spendlove wrote: Hi Marshall/Josh Thanks for the info. I've installed Page Factory and Page Parts and I agree, very useful functionality. Unfortunately I get an error when I try and output the date held in my start_page part using the tag. I can output the date just fine if I use , obviously the date is then unformatted: StandardTags::TagError (Invalid value for 'for' attribute.): vendor/radiant/app/models/standard_tags.rb:597:in `tag:date' vendor/radiant/lib/radiant/taggable.rb:33:in `send' vendor/radiant/lib/radiant/taggable.rb:33:in `render_tag' vendor/radiant/app/models/page_context.rb:10:in `initialize' vendor/radiant/vendor/radius/lib/radius/context.rb:62:in `call' vendor/radiant/vendor/radius/lib/radius/context.rb:62:in `render_tag' vendor/radiant/vendor/radius/lib/radius/context.rb:93:in `stack' vendor/radiant/vendor/radius/lib/radius/context.rb:61:in `render_tag' vendor/radiant/app/models/page_context.rb:18:in `render_tag' vendor/radiant/vendor/radius/lib/radius/parser.rb:50:in `stack_up' vendor/radiant/vendor/radius/lib/radius/parse_tag.rb:12:in `call' vendor/radiant/vendor/radius/lib/radius/parse_tag.rb:12:in `to_s' vendor/radiant/vendor/radius/lib/radius/parser.rb:54:in `stack_up' vendor/radiant/vendor/radius/lib/radius/tag_binding.rb:33:in `call' vendor/radiant/vendor/radius/lib/radius/tag_binding.rb:33:in `expand' vendor/extensions/page_parts/lib/page_parts/page_part_tags.rb:65:in `tag:if_later' I installed Page Parts with script/extension install and I'm on 0.9RC2. Any ideas out there? Josh? Cheers Matt -- http://cenatus.org/ http://radialsolutions.co.uk/ -- On Sat, Jun 19, 2010 at 8:00 PM, Marshal Linfoot wrote: Hi Brian. In case you're thinking about using the page_parts extension, I have a simple example to show how that might work for you. Page_factory and page_parts are two excellent extensions, by the way -- highly recommend them. Page_parts comes with some built-in custom parts, in particular the datetime part is very useful. In my site, I use page_parts to define the startdate and enddate of events. These are tabs that have a calendar date picker, really convenient when adding a new event, less error prone than typing the date. The content of the startdate and enddate parts can then be used anywhere in your site. Let's say from some other page you wanted to list upcoming events. The code would look something like this: /> This assumes your events are ordered by start date. Hope this helps as a starting place for some ideas. -- marshal
Re: [Radiant] Re: show upcoming events
Hi Marshall/Josh Thanks for the info. I've installed Page Factory and Page Parts and I agree, very useful functionality. Unfortunately I get an error when I try and output the date held in my start_page part using the tag. I can output the date just fine if I use , obviously the date is then unformatted: StandardTags::TagError (Invalid value for 'for' attribute.): vendor/radiant/app/models/standard_tags.rb:597:in `tag:date' vendor/radiant/lib/radiant/taggable.rb:33:in `send' vendor/radiant/lib/radiant/taggable.rb:33:in `render_tag' vendor/radiant/app/models/page_context.rb:10:in `initialize' vendor/radiant/vendor/radius/lib/radius/context.rb:62:in `call' vendor/radiant/vendor/radius/lib/radius/context.rb:62:in `render_tag' vendor/radiant/vendor/radius/lib/radius/context.rb:93:in `stack' vendor/radiant/vendor/radius/lib/radius/context.rb:61:in `render_tag' vendor/radiant/app/models/page_context.rb:18:in `render_tag' vendor/radiant/vendor/radius/lib/radius/parser.rb:50:in `stack_up' vendor/radiant/vendor/radius/lib/radius/parse_tag.rb:12:in `call' vendor/radiant/vendor/radius/lib/radius/parse_tag.rb:12:in `to_s' vendor/radiant/vendor/radius/lib/radius/parser.rb:54:in `stack_up' vendor/radiant/vendor/radius/lib/radius/tag_binding.rb:33:in `call' vendor/radiant/vendor/radius/lib/radius/tag_binding.rb:33:in `expand' vendor/extensions/page_parts/lib/page_parts/page_part_tags.rb:65:in `tag:if_later' I installed Page Parts with script/extension install and I'm on 0.9RC2. Any ideas out there? Josh? Cheers Matt -- http://cenatus.org/ http://radialsolutions.co.uk/ -- On Sat, Jun 19, 2010 at 8:00 PM, Marshal Linfoot wrote: > Hi Brian. > > In case you're thinking about using the page_parts extension, I have a > simple example to show how that might work for you. Page_factory and > page_parts are two excellent extensions, by the way -- highly recommend > them. Page_parts comes with some built-in custom parts, in particular the > datetime part is very useful. > In my site, I use page_parts to define the startdate and enddate of events. > These are tabs that have a calendar date picker, really convenient when > adding a new event, less error prone than typing the date. The content of > the startdate and enddate parts can then be used anywhere in your site. > Let's say from some other page you wanted to list upcoming events. The code > would look something like this: > > > > > /> > > > > > This assumes your events are ordered by start date. > Hope this helps as a starting place for some ideas. > -- > marshal >
Re: [Radiant] Re: show upcoming events
Hi Brian. In case you're thinking about using the page_parts extension, I have a simple example to show how that might work for you. Page_factory and page_parts are two excellent extensions, by the way -- highly recommend them. Page_parts comes with some built-in custom parts, in particular the datetime part is very useful. In my site, I use page_parts to define the startdate and enddate of events. These are tabs that have a calendar date picker, really convenient when adding a new event, less error prone than typing the date. The content of the startdate and enddate parts can then be used anywhere in your site. Let's say from some other page you wanted to list upcoming events. The code would look something like this: This assumes your events are ordered by start date. Hope this helps as a starting place for some ideas. -- marshal
Re: [Radiant] Re: show upcoming events
We could have avoided this had I been more accurate. PageParts works fine on the latest release candidate gem, and I believe the prerelease gem before that as well. On Jun 18, 2010, at 1:11 PM, Matt Spendlove wrote: Brian - see my previous reply. Sometimes the threads get a bit a bit out of order with Google Groups. Check here: http://groups.google.com/group/radiantcms/browse_thread/thread/143ace2ec13506da On Jun 18, 6:07 pm, Brian Loomis wrote: anyone? On Jun 18, 2010, at 8:09 AM, Brian Loomis wrote: What does this mean? being on edge? On Jun 18, 2010, at 7:36 AM, Josh French wrote: If you're on edge Brian Loomis Brian Loomis
Re: [Radiant] Re: show upcoming events
anyone? On Jun 18, 2010, at 8:09 AM, Brian Loomis wrote: > What does this mean? being on edge? > > On Jun 18, 2010, at 7:36 AM, Josh French wrote: > >> If you're on edge > > Brian Loomis Brian Loomis
Re: [Radiant] Re: show upcoming events
Brian - Edge is the latest version of code in the repository i.e. not a guaranteed stable release. See http://radiantcms.org/download/ -- http://cenatus.org/ http://radialsolutions.co.uk/ -- On Fri, Jun 18, 2010 at 3:09 PM, Brian Loomis wrote: > What does this mean? being on edge? > > On Jun 18, 2010, at 7:36 AM, Josh French wrote: > >> If you're on edge > > Brian Loomis >
Re: [Radiant] Re: show upcoming events
What does this mean? being on edge? On Jun 18, 2010, at 7:36 AM, Josh French wrote: > If you're on edge Brian Loomis
Re: [Radiant] Re: show upcoming events
If you're on edge, you might also consider the PageParts extension. It can be used to add a dedicated datetime field to a page (instead of storing dates as text, or repurposing published_at.) It also provides some new tags like if_earlier/if_later for working with datetime fields. j On Jun 18, 2010, at 9:30 AM, Matt Spendlove wrote: Thanks Jim. I realise that it's a unusual usage as News items are normally either current or past but the thinking was they'd post a News item as at "today" referring to an upcoming event. Perhaps we'll have to rethink this.. Matt On Jun 18, 2:21 pm, Jim Gay wrote: On Fri, Jun 18, 2010 at 8:44 AM, Matt Spendlove wrote: Hi all I have a News page of archive page type. Users can tag the pages into "news", "events", "offers" etc. I'd like to be able to show upcoming events in a sidebar. I can search for all items tagged with "events" and display them, but how do I show only events where >= TODAY ? I didn't really want to go down the route of using a dedicated calendar extension [1] as it's overkill for the requirements. I can't see to be able to do any kind of conditional fiter on the date? Your thoughts appreciated. Matt [1]http://github.com/davec/radiant-events-calendar-extension There's no notion of "upcoming" with the archive pages. To do this, you'll need to create an new tag (in a custom extension). Here's some quick code that should get you along: tag 'upcoming' do |tag| tag.locals.upcoming = Page.all(:conditions => ['whatever_date > ?',Time.now] tag.expand end tag 'upcoming:each' do |tag| result = [] tag.locals.upcoming.each do |page| tag.locals.page = page result << tag.expand end result end -- Jim Gay Saturn Flyer LLChttp://www.saturnflyer.com 571-403-0338