Change heading tag in core components
Other than resorting to javascript, aria or recreating the component from scratch is there a simple way to set the starting h tag level for a core component? For example I want a component to start at h3 NOT h2 as I've now nested it under a title which is h2.
Hi Malcolm-M,
We have limited support for changing heading tags:
https://community.khoros.com/t5/Search-tools/Set-SEO-options/ta-p/108583
There was a similar question that mentions the above two settings:
https://community.khoros.com/t5/Khoros-Community-Product/How-can-I-get-one-H1-per-page-for-SEO/m-p/628686
Outside of those settings, there is no out-of-the-box way.There might be a "middle-ground", e.g. you don't have to recreate the component from scratch if you use @override 's for the native component. Assign the OOB component's output to a variable (capture the output of the OOB component) like this:
<#assign oob> <@delegate /> </#assign>
Then you could simply replace h2's with h3's:<#assign output = oob?replace('h2', 'h3', 'rmi') /> ${output}
maybe you want to make the replacer a bit more sophisticated (e.g. use a proper regex), but I think for headings it should do...
and of course you need to create the @override component, e.g. whatever component is rendering the headings (the native one) create a new one with the same name and add @override to the name. You won't have to do anything in quilts this way.