Hoping I can get some help with this issue. On the bottom of the page, we have a piece of code that says "Page Last Updated on" and the date. The date is being pulled from the UpdateDate from the current page. The only problem is that we have media associated with each page that is updated outside of it. When the media is updated, how can I get the page updated date to change when new media is shown?
Here is the code i was talking about so far with the updatepage.xslt
The shown media will be updated in the media section. When this happens, the date that the media is updated in the media section should become the new page update.
Have you set a custom "updated" field on the media item? I have just been playing around with it locally...
And when I create a media item and choose an image and hit save I can see the "Create date". But if I choose another image to overwrite the initial image and hit save, I don't get an updated date and the "create date" stays the same...
But anyhow you need to create a relation somehow, which I cannot figure out at the moment...will turn back if I come up with something...
Let me know if you happened to find anything. I was playing around with it, and for some reason I can't get it to call the media Date that is put on the media item.
3) In your XSLT macro you should be able to make a check for this "umbracoUpdateDate" property and see if it's empty or actually contains a date. If it's empty you use the data from your document. If it's not you use the date from the field.
Have I overlooked something? I think that this should actually work...To make a quick proof of concept you can of course just start by selecting the date manually to see what happens etc.
Page Update Date
Hi All,
Hoping I can get some help with this issue. On the bottom of the page, we have a piece of code that says "Page Last Updated on" and the date. The date is being pulled from the UpdateDate from the current page. The only problem is that we have media associated with each page that is updated outside of it. When the media is updated, how can I get the page updated date to change when new media is shown?
Here is the code i was talking about so far with the updatepage.xslt
How do you want to update the shown media? In the media section?
If so...will you then be overwriting the current content of the media item, which is used on a given page?
Or will you pick the new media from within the rich text editor or how you insert it on your content node?
/Jan
The shown media will be updated in the media section. When this happens, the date that the media is updated in the media section should become the new page update.
Have you set a custom "updated" field on the media item? I have just been playing around with it locally...
And when I create a media item and choose an image and hit save I can see the "Create date". But if I choose another image to overwrite the initial image and hit save, I don't get an updated date and the "create date" stays the same...
But anyhow you need to create a relation somehow, which I cannot figure out at the moment...will turn back if I come up with something...
/Jan
Awesome.. I will work on this too.. Please let me know if you come up with anything.
Let me know if you happened to find anything. I was playing around with it, and for some reason I can't get it to call the media Date that is put on the media item.
Well it's also some tricky stuff you want to achieve I think...
But I think that you might be able to succeed if you do this...from the top of my head and NOT tested anywhere
1) Extend the image mediatype width a property called "umbracoUpdateDate" and choose either date or date with time for this.
2) Hook into an event perhaps the MediaType "AfterSave" event (full event reference http://our.umbraco.org/wiki/reference/api-cheatsheet/using-applicationbase-to-register-events/overview-of-all-events) and be sure to update the date of the property when you change the image
3) In your XSLT macro you should be able to make a check for this "umbracoUpdateDate" property and see if it's empty or actually contains a date. If it's empty you use the data from your document. If it's not you use the date from the field.
Have I overlooked something? I think that this should actually work...To make a quick proof of concept you can of course just start by selecting the date manually to see what happens etc.
Give it a go :-)
/Jan
is working on a reply...