I'm extending the SXA Accordion component to add a header to the accordion. Ok, derive a template from Accordion template, add the Page Component to the presentation details for the standard values, create a new controller, model, repository and view, all based on the Accordion component.
@if (Model.Rendering.DataSourceItem != null)
{
if (Model.Title == null)
{
using (Html.Sxa().BeginEditFrame(Html.Sitecore().CurrentRendering.DataSource, "Header Empty", Model.IsControlEditable))
{
<div class="accordion-header">
[Heading is empty]
</div>
}
}
else
{
using (Html.Sxa().BeginEditFrame(Model.Title.ID, "Header", Model.IsControlEditable))
{
var titleKey = string.Format("{0}-{1}", titleBaseKey, Model.Id);
<div class="accordion-header">
@Html.Sitecore().Placeholder(titleKey)
</div>
}
}
}
In the new template, I added a Title field (rich text). The Title field in the model is just the rendering DataSourceItem. How do I get the Title field of the new template to show up as a variant in the rendering parameters for the Page Content? Remember the new template has the Accordion as the base template.