Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello,
How can i get the publication date of a content ? using a macro.
Thank you by advance
In your Razor file, use:
@Model.CreateDate
I prefered to use UpdatedDate.
What i want now i to implement it in the foreach.
Here is my code :
@if (!string.IsNullOrEmpty(Model.publicationEndDate.ToString())) { foreach (var item in Model.Children.Where("umbracoNaviHide != true").OrderBy("UpdateDate")) { if (item.UpdateDate > Model.publicationEndDate) { <h3 class="headline"> <a href="@item.Url">@item.Title</a> </h3> <small class="meta"> Posted: @umbraco.library.LongDate(@item.UpdateDate.ToString(), true, " - ") </small> <br /> <p class="introduction"> @item.description </p> } } }
Alright no problem, so what is the issue you run into now? Is the expected output wrong, do you get errors?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Get publication date
Hello,
How can i get the publication date of a content ? using a macro.
Thank you by advance
In your Razor file, use:
I prefered to use UpdatedDate.
What i want now i to implement it in the foreach.
Here is my code :
Alright no problem, so what is the issue you run into now? Is the expected output wrong, do you get errors?
is working on a reply...