I'm trying to output my partial view on my front page. However, it won't allow me to output some of my values (data type values). At the moment i try to list out the datatype i made for a blog post (a title in a h2). It will not be shown. I think it has something to do with me not allowing content from other datatypes to appear on some sites. But im not sure.
Heres my partial view. At the very top is the following code:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var selection = Model.Content.Site().FirstChild("portfolio").Children()
.Where(x => x.IsVisible())
.OrderBy("CreateDate desc");
Glad it's working for you!, there are possibly 5 different ways to write out the value of an Umbraco property - because of the evolution of Umbraco templating over the years, along with the desire to keep backwards compatibility... so it can get a little confusing!
Outputting value from Partial View
Hi guys,
I'm trying to output my partial view on my front page. However, it won't allow me to output some of my values (data type values). At the moment i try to list out the datatype i made for a blog post (a title in a h2). It will not be shown. I think it has something to do with me not allowing content from other datatypes to appear on some sites. But im not sure.
Heres my partial view. At the very top is the following code:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
}
So what i basicly want to do is: – Output data from one document type in another document type via partial view.
Really hope that someone can help me with this. :-)
If my question is not clear, please let me know and ill try to specify.
Best regards Lasse
Hi Lasse
I think this is because Umbraco.Field will always try to write out a property from the Current Page you are on...
... whereas in your for each loop you want to write out the property value from your 'item' in the selection.
So you should be able to write the header as:
to output the values from each 'item'
If that helps?
regards
marc
You must be some kind of a sorcerer – it worked like a dream! Thank you so much, Mark!
Cool!
Glad it's working for you!, there are possibly 5 different ways to write out the value of an Umbraco property - because of the evolution of Umbraco templating over the years, along with the desire to keep backwards compatibility... so it can get a little confusing!
is working on a reply...