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 LLC
http://www.saturnflyer.com
571-403-0338
j
<r:ruby>
@date_today = <r:date for='now' format='%Y%j' />
""
</r:ruby>
<r:ruby>
@date_article = <r:date format='%Y%j' />
""
</r:ruby>
<r:if cond=" @date_today == @date_article ">Show Upcoming events</r:if>
On Jun 18, 2010, at 7:36 AM, Josh French wrote:
> If you're on edge
Brian Loomis
----------------------------------------------
http://cenatus.org/
http://radialsolutions.co.uk/
----------------------------------------------
Brian Loomis
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 <r:date for="start_date" /> tag. I can
output the date just fine if I use <r:content part="start_date"/> ,
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/
----------------------------------------------
j
----------------------------------------------
http://cenatus.org/
http://radialsolutions.co.uk/
----------------------------------------------
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
--
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