I always land on an empty page when I want to view my post , what to do
Hi, I am making a page where all blog posts are displayed. When you click on the post, you must be sent to the page with the post.
The first one works fine but when I click on the link that will send me to the post, I will be sent to an empty page. How do i do it??
My partial view that runs through all posts.
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var selection = Model.Content.Site().FirstChild("blog").Children("blogIndlaeg")
.Where(x => x.IsVisible());
}
<div class="container">
<div class="row">
<!-- Blog titel -->
@Umbraco.Field("blogTitel")
<br />
@foreach(var item in selection){
<!-- blog teaser -->
@Umbraco.Field("blogTeaser")
<br />
<!-- Henter alle blog billederne -->
<a href="@item.Url">
@{
var blogImage = item.GetPropertyValue<IPublishedContent>("fremhaevetBillede");
if (blogImage != null)
{
<img src="@blogImage.Url" class="img-responsive"style="width: 25%;"/>
}
}
</a>
<br />
<h4>@item.Name</h4>
<br/>
<a href="@item.Url">Læs mere</a>
<hr>
}
</div>
</div>
The page where the specific post is displayed.
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage<ContentModels.BlogIndlaeg>
@using ContentModels = Umbraco.Web.PublishedContentModels;
@{
Layout = "Master.cshtml";
}
<div class="container">
<div class="row">
<!-- The blot title -->
@Umbraco.Field("blogTitel")
<br />
<!-- The blog text -->
@Umbraco.Field("bodyTekst")
</div>
</div>
I always land on an empty page when I want to view my post , what to do
Hi, I am making a page where all blog posts are displayed. When you click on the post, you must be sent to the page with the post. The first one works fine but when I click on the link that will send me to the post, I will be sent to an empty page. How do i do it??
My partial view that runs through all posts.
The page where the specific post is displayed.
Hi Mikkel
Empty page - did you mean just blank page?
Do you have right Layout settings?
Thanks,
Alex
yep i getting a blank page, but should there not be som code to get the data with on that page ?
Hi Mikkel,
Is the template selected on the node (see the Properties tab)?
Have seen behaviour like this when people forget to select/change the template for a particular DocType.
Craig
Hi Craig the template is selected but there should there not be some code to retrieve the specified post on the page??
is working on a reply...