Forum: Radiant CMS Date tag oddness

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A47e0a6beeb9d048ff054fc1c3a97418?d=identicon&s=25 Walter Davis (walterdavis)
on 2007-03-21 18:21
(Received via mailing list)
I cannot for the life of me figure out what drives the decision of
WHICH year this tag means:

<r:date format="%Y" />

I have tried updating the content in the footer snippet, the Home page,
etc. New pages get the correct year, but old pages get whatever year
they were created in, it seems.

Is there a tag I can use that means This Year, as in what year the
server thinks it is at the moment?

Thanks,

Walter
8802b1fa1b53e2197beea9454244f847?d=identicon&s=25 Sean Cribbs (Guest)
on 2007-03-21 18:24
(Received via mailing list)
Walter,

The <r:date /> tag uses the published date of the current page. There
is not currently a tag that gives the current date, although its
implementation would be trivial.

Sean
6ec6f77ea603dd75b3a7a7775b059e79?d=identicon&s=25 John W. Long (Guest)
on 2007-03-21 18:35
(Received via mailing list)
Walter Lee Davis wrote:
> I cannot for the life of me figure out what drives the decision of
> WHICH year this tag means:
>
> <r:date format="%Y" />

It's the published_at date.

--
John
A47e0a6beeb9d048ff054fc1c3a97418?d=identicon&s=25 Walter Davis (walterdavis)
on 2007-03-21 18:44
(Received via mailing list)
On Mar 21, 2007, at 1:34 PM, John W. Long wrote:

> Walter Lee Davis wrote:
>> I cannot for the life of me figure out what drives the decision of
>> WHICH year this tag means:
>>
>> <r:date format="%Y" />
>
> It's the published_at date.
>

So how can I bump this date? Do I unpublish and then re-publish a page?
And if so, which one? I would like to bump the date for the entire site
(in the footer).

Thanks,

Walter
6ec6f77ea603dd75b3a7a7775b059e79?d=identicon&s=25 John W. Long (Guest)
on 2007-03-21 20:23
(Received via mailing list)
Walter Lee Davis wrote:
> So how can I bump this date? Do I unpublish and then re-publish a page?
> And if so, which one? I would like to bump the date for the entire site
> (in the footer).

You would have to do that manually. Set the published_at date to nil and
the status to draft. Then change it to published again.

Something like this in script/console might work:

page = Page.find_by_url('/path/to/my/page')
page.status = Status[:draft]
page.published_at = nil
page.save!
page.status = Status[:published]
page.save!

--
John Long
http://wiseheartdesign.com
A47e0a6beeb9d048ff054fc1c3a97418?d=identicon&s=25 Walter Davis (walterdavis)
on 2007-03-21 20:51
(Received via mailing list)
Thanks.

On Mar 21, 2007, at 3:22 PM, John W. Long wrote:

>>
> Something like this in script/console might work:
>
> page = Page.find_by_url('/path/to/my/page')
> page.status = Status[:draft]
> page.published_at = nil
> page.save!
> page.status = Status[:published]
> page.save!
>

I would like to second the motion for a tag that means Current Date. I
very often put the following in the footer of pages I make in PHP:

Copyright &copy;2004—<?=date('Y',time())?> Walter Davis Studio...

That's basically all I am after here in the footer. I had a really
confusing journey through the Ruby documentation, trying to find the
equivalent so I could try just writing this myself. But my lack of
patience and experience conspired against me figuring this out.

Thanks again,

Walter
This topic is locked and can not be replied to.