Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Block component with TemplateDescriptor is hit only for "Display as: Automatic"

Vote:
 

Hi 

I am not sure if I have found a bug or we have something wrong in our setup. Version Episerver CMS 12.24.0 (everything else has also been updated to date)

When I use TemplateDescriptor on a component of a block and call this component with a "XXX" tag:

@Html.PropertyFor(m => m.CurrentPage.ContentArea, new {tag = "XXX"})

it works fine until I change the "Display as: Automatic" in CMS to some other value. Then only the regular Component is hit.

Component that should be called:

[TemplateDescriptor(AvailableWithoutTag = false, Tags = new[] { "XXX" })]
public class FooBlockXXXComponent : AsyncBlockComponent<FooBlock>

Our configuration of DisplayOptions:
services.Configure<DisplayOptions>(displayOption =>
{
    // TODO: Add/check breakpoints for mobile views for col definitions (e.g. "col-md-6 col-12" for half, etc.)
    displayOption.Add("full", "/displayoptions/full", "col-12", "", "epi-icon__layout--full");
    displayOption.Add("half", "/displayoptions/half", "col-md-6 col-12", "", "epi-icon__layout--half");
    displayOption.Add("wide", "/displayoptions/wide", "col-md-8 col-12", "", "epi-icon__layout--two-thirds");
    displayOption.Add("narrow", "/displayoptions/narrow", "col-md-4 col-12", "", "epi-icon__layout--one-third");
    displayOption.Add("one-quarter", "/displayoptions/one-quarter", "col-md-3 col-12", "", "epi-icon__layout--one-quarter");
});

Thank you for any advice!

Petr

#312823
Nov 20, 2023 15:00
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.