Hello
I keep getting this error with @RenderBody ().
I have made a master document type and below it a home page document type. When I use @RenderBody on MasterTemplaten then comes the error, what is it that i dont do right??
Excuse my late reply, I've been a little hung up.I had solved it, I should put a comma and remove the semicolon and so it worked.I have another problem, mediapicker how do I get it to display the picture out of the page where the image to be displayed, and what do you use to choose only one image, if there are only have to be 1 photo on the page.
I've tried different things to get the picture shown as, for example
@if (CurrentPage.HasValue("vaelgBillede"))
{
var caseStudyImagesList = CurrentPage.CaseStudyImages.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
var caseStudyImagesCollection = Umbraco.Media(caseStudyImagesList);
@if (CurrentPage.HasValue("vaelgBillede"))
{
var caseStudyImagesList = CurrentPage.CaseStudyImages.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
var caseStudyImagesCollection = Umbraco.Media(caseStudyImagesList);
foreach (var caseStudyImage in caseStudyImagesCollection)
{
<img src="~/media/@caseStudyImage.Url" style="width:300px;height:300px" />
}
}
keep getting renderbody error
Hello I keep getting this error with @RenderBody (). I have made a master document type and below it a home page document type. When I use @RenderBody on MasterTemplaten then comes the error, what is it that i dont do right??
and merry christmas to every one :)
Hey there Mikkel! Would you mind snapping a screenshot for me so I could take look of the error and your code? :)
Cheers,
-Georgs
Excuse my late reply, I've been a little hung up.I had solved it, I should put a comma and remove the semicolon and so it worked.I have another problem, mediapicker how do I get it to display the picture out of the page where the image to be displayed, and what do you use to choose only one image, if there are only have to be 1 photo on the page.
I've tried different things to get the picture shown as, for example
@if (CurrentPage.HasValue("vaelgBillede")) { var caseStudyImagesList = CurrentPage.CaseStudyImages.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); var caseStudyImagesCollection = Umbraco.Media(caseStudyImagesList);
And
and
@Umbraco.Field("vaelgBillede")
and
and the last one
i am a litle lost on that one
thanks for loocking at it and merry christmas :D
Hi Mikkel,
If you only want to pick one image, then you should you the media picker as you do and then use this Razor code.
The above code is dynamic Razor if you want to use strongly typed Razor then the code needs to look like this.
Hope this helps,
/Dennis
that workt great, thanks for your help :)
is working on a reply...