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
Is the markup the same when used in other blocks?
Is the samme CSS available in both cases?
Are you using ContentArea to render this block or using XhtmlString?
Make sure the parent property rendering it properly. Like-
@Html.PropertyFor(m => m.MainContentArea)
Hello,
we are having an issue creating a button block. When we use the block on a page, it renders perfectly fine. However, it does not display as a button when used with another block, it just shows the name of the block as text. The view should render it as a button, but it isnt working on blocks for whatever reason. Does anyone know what could cause this block to render differently on blocks vs pages?
Our button model:
using CapCom.Epi.Core.Models.Base; using EPiServer; using EPiServer.DataAbstraction; using System.ComponentModel.DataAnnotations; namespace CapCom.Epi.Core.Models.Blocks { /// <summary> /// Used to insert a link which is styled as a button /// </summary> [SiteContentType(GUID = "426CF12F-1F01-4EA0-922F-0778314DDAF0")] [SiteImageUrl] public class ButtonBlock : BaseBlock { [Display(Order = 1, GroupName = SystemTabNames.Content)] [Required] public virtual string ButtonText { get; set; } [Display(Order = 2, GroupName = SystemTabNames.Content)] [Required] public virtual Url ButtonLink { get; set; } } }
Our button view: