Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Does it say it can't find a renderer for the property? If I recall correctly, the correct path to the ImageBlock partial should be "Views/Shared/ImageBlock.cshtml", unless you are pushing the block through a controller.
Hi, Tahir,
I have not placed my ImageBlock (that I am using as local block and rendering with PropertyFor) inside Views/Shared/ImageBlock.cshtml.
Instead, I have placed it inside Views/Shared/DisplayTemplates/ImageBlock.cshtml
i'm facing a similar dilema to Tahir, I have tried putting into DisplayTemplates although still get the message their is no render for this block.
For now I am using seperate controllers although dont think this is the tidiest thing to do.
I have a custom block with two properties - an image url and an alternative text
[ContentType( GUID = "387A029C-F193-403C-89C9-375A2A6BF028", AvailableInEditMode = false, DisplayName = "Image" )] public class ImageBlock : EPiServer.Core.BlockData { [UIHint(UIHint.Image)] [Display( Name = "Image Url", Description = "", GroupName = SystemTabNames.Content, Order = 10)] public virtual Url ImageUrl { get; set; } [Display( Name = "Alternative text", GroupName = SystemTabNames.Content, Order = 20)] [CultureSpecific] public virtual string AlternativeText { get; set; } }
I have created a partial view in shared directory /shared/ImageBlock/index.cshtml as
@model ImageBlock <img src="@Model.ImageUrl" />
So I am hoping when I call something like
My partial view should get called, but the partial view never gets called.
- TestProperty is a property of type ImageBlock
Can any body please help me