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
I got some problem on my blog page. When I create a blog-post the date is always 15 October - and that is the date, when I created the blog page. Here is my code:
<!--Blogs--> @foreach (var blogPost in items.Skip((page - 1) * pageSize).Take(pageSize).OrderBy(x => x.CreateDate)) { <!--Article--> <article class="post-preview"> <a href="@blogPost.Url"> <h2 class="post-title">@blogPost.Name</h2> <h3 class="post-subtitle">@blogPost.GetPropertyValue("blogSubheader")</h3> </a> <p class="post-meta"> Posted by <a href="@blogPost.Url">@Model.Content.CreatorName</a> on @Model.Content.CreateDate.ToString("MMMM d, yyyy") </p> </article> <hr /> }
When I create a blog-post, I want them to have the todays date, and not the same one - hope my question was understandable!
Thanks in advance!
Please someone who can help me with this!
Hi Sharmarke,
Why are you doing @Model.Content.CreateDate?
By the looks of your code that would be the Create Date of the page as a whole not the individual blog posts.
Because you are iterating around a collection, I suspect you need to change it to be @blogPost.CreateDate
Try that and see how it goes.
I was watching a video the other day - and I'm new to Umbraco...
But now it is working! Thanks!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
It always creates the same datetime!
I got some problem on my blog page. When I create a blog-post the date is always 15 October - and that is the date, when I created the blog page. Here is my code:
When I create a blog-post, I want them to have the todays date, and not the same one - hope my question was understandable!
Thanks in advance!
Please someone who can help me with this!
Hi Sharmarke,
Why are you doing @Model.Content.CreateDate?
By the looks of your code that would be the Create Date of the page as a whole not the individual blog posts.
Because you are iterating around a collection, I suspect you need to change it to be @blogPost.CreateDate
Try that and see how it goes.
I was watching a video the other day - and I'm new to Umbraco...
But now it is working! Thanks!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.