Modify %letter_group% keyword


(Steven) #1

Hi,

I have lots of pages that use the %letter_group% for listings.

There is an accessibility issue I want to address with the output of %letter_group% but I’m not sure how or where to edit the output.

The output: <a name="letter_A">A</a>

This anchor tag needs an href attribute or preferably this tag can be changed to another element like H3.

Do you know how to convert the output so it displays an H3 tag instead of a tag?

Thanks
S


(Iain Simmons) #2

Hi @sgardner,

So, the first, hacky solution would be to use ^replace and ^tagif modifiers (I don’t know for sure how well these would work):

%letter_group^replace:name=":href="#^tagif:h3%

Before: <a name="letter_A">A</a>
After: <h3><a href="#letter_A">A</a></h3>

Again, best to check if those work as expected.

The other solution is to instead use Asset grouping and group by a keyword that uses the first letter of the asset name or short name, like asset_short_name^maxchars:1^uppercase

Then you would use the %group_name% keyword and could put it in whatever format you like.

Cheers,
iain