Show last updated date in umbraco - umbraco

I want to display last updated date in umbraco 4.7
Say if i even make a small change in content from the admin panel, it has to pull the updated date so that i can show that in footer of the website dynamically.
Thanks.

Every node has a property called updateDate which you can get in razor by using:
#Model.UpdateDate

If I understand this correctly, you want it so that any update to any content item updates the "last updated" information in your footer.
I'd hook into the publish event (this link should get you started),create a variable to store the date, and update it every time a node gets published, then read and output it in the code that generates your footer.

Related

Sort by publish date, even if publish date is tomorrow or 2 years ago

I'm trying to make this as intuitive for my customer as possible. They already have many news articles they need moved to this new Umbraco 7 site. I want the following to happen:
If they make a news article and set the "Publish At" date to tomorrow, it will not show on the page until tomorrow.
If they do not set a "Publish At" date, it should look at the published date (you would not fill out the "Publish At" date if you want it published now)
If they edit an old article, it should not affect the sorting at all (meaning UpdateDate shouldn't work)
If there are n articles all released today, and someone publishes a news article with "Publish At" set to yesterday, it will put the news article before the 3 new ones
Is something like this possible, without creating an additional property? That's, in my opinion, just going to confuse the person.
So apparently the only way to do this, is by creating an additional field with type Date. I was hoping I could do this through the built in ones from Umbraco.
Turns out there are no "this is the exact date when this article was published" property I can access, while still getting this to work. It does give the creator a few options regarding the sorting, as it's very easy to sort them by date now.
As far as I understand your scenario, here are my replies to each of your questions
If they make a news article and set the "Publish At" date to tomorrow, it will not show on the page until tomorrow.
Ans - If they set the Publish At date to tomorrow and just save that article, then it would never be published until tomorrow. If the page is already published, then it needs to be unpublished first.
If they do not set a "Publish At" date, it should look at the published date (you would not fill out the "Publish At" date if you want it published now)
Ans - They just need to click save and publish to publish the article now.
If they edit an old article, it should not affect the sorting at all (meaning UpdateDate shouldn't work)
Ans - You can handle this in ContentService_Saving event. Refer - ContentService Events
If there are n articles all released today, and someone publishes a news article with "Publish At" set to yesterday, it will put the news article before the 3 new ones
Ans - Taken from This Umbraco forum . Adding this for everyone here as well.
I would create the property SortDate, and another true/false property PublishMode. While SortDate is self-explanatory, I would set PublishMode to true once you are done drafting and adding content to a page. So if I've written a page and only need to fix typos and reword after it has been published, this would be set to true.
I would then hook into a republish event and add some logic like so:
if (page's type alias is a post) && (PublishMode is false) {
if (DateCompare(page.CreateDate, page.UpdateDate) >= 0
{ page.SortDate = page.CreateDate }
else {page.SortDate = page.UpdateDate}
}
So then after you're done, you can have a date that will be sorted depending on the "mode" of the document while it is being republished.
As a side note, even if you don't have a date picked, the datepicker datatype automatically sets itself to something like "01/01/0011". So it would never return a null value.
Also, the datepicker datatype is not a DateTime object. So to use the DateCompare, you have to parse each date property into a DateTime object like:
DateCompare(DateTime.Parse(Page.CreateDate.ToString("r"), DateTime.Parse(Page.UpdateDate.ToString("r"))
Hope this helps!!
Thanks

Umbraco Same Url Render Page Sequence

I'm new to umbraco and using umbraco 6 latest version... Actually this is a silly mistake but makes me curious..
I've two content, let's say item a and item b.. This two item will be published alternately. so it can be access via "mysite/item_active"..
Today -> item a -> change name to item_active -> save publish -> change yesterday item active to item_b..
But somehow I forgot to use save publish yesterday.. And only click save that make the url of the content is not being updated..
Then how umbraco will choose with item to render (both item now have "mysite/item_active" url)?
The day I asked you is holiday until monday.. And I don't have access this site (because this internal company site) from home..
Are based on node? the smaller node is the one being render or the latest publish item will be rendered?
Umbraco won't allow you to save and publish two items with the same URL / node name (on the same tree level). It will automatically add version number e.g. (1) for the next node with the same name and then, friendly URL will become /mysite/item-active-1 in your case.
I tested this scenario, and Umbraco returns this information when you're trying to publish item with the same name as existing one:
So, in theory - we have two items published, but only one is still in the XML (IPublishedContent) cache, from which Umbraco is taking content first. Second item won't be visible until we will change the URLs / names to be different or perform publish on first item and then scenario described at the beggining will be applied.
Maybe it's worth to consider having it as a same page and just swaping the templates on which you can render particular properties values? Or having a content picker or something else to determine which version of the site should be marked as active and used?

How do I set the last updated time to dateSignedTabs in docusign, thru API

I have a date field in my document and I would like to set the last updated time of the document, or the time on which a particular event had occurred in the document. My document will have both signers and counter signers as well.
I am developing my application using Rails and I am using the Docusign REST GEM.
You can retrieve the envelope's history and audit events through the audit events API, then once you have your date you can simply set the value of your dateTab using the tab's value property.
NOTE: Make sure you use dateTabs and not dateSignedTabs. Date signed tabs are populated by the platform, based on the date that recipient signs the document.

Refresh Page On Save And Publish

I've created doc type with property e.g. (Name = "ItemId" Type = "Label") When i try to "Save and Publish" node with current doc type i set some value to this label. (note that i override SendAsync method)
currentContent.SetValue("ItemIdAlias","guidvalue");
It sets value correctly, but label still appears to be empty. So if i click on "Save and Publish" second time it sends an empty value still... I need somehow to refresh page because on second time i need "guidvalue" to update other items
If you're using Umbraco 6, you'll need to get your event handler to emit some JS to refresh the page. You can do this by calling the following code in your Event Handler:
BasePage.Current.ClientTools.ChangeContentFrameUrl(string.Concat("editContent.aspx?id=", docId));
Where docId is the id of the page you are editing. This will force a full reload of the page, and your label should then have a value!
If you're using Umbraco 7, you're out of luck, there's currently no way to do this from the server side. You might be able to listen to the angular save event and do something there maybe? But I'm not 100% if that's possible currently.

Sharepoint portal 2007 view modified date

I am using MS Sharepoint portal 2007. I have created views from the data already existed. I need the users to update everyday the status. Any way I know if they have updated like can I get a date modified column or row?
If I have understand your question right, then you want to get the ROw modified date in your view? Correct me if i am wrong?
If that is your requirement then you have to modify that view and select the column named as "Modified" and If you want to have the user name then also select "Modified By" column.
let me know the result.
Thanks

Resources