Decorators in Child Theme

Hi,

I need to change the aria-labels in few of the elements and thought I could use the same idea of doing this in a child theme.

I replicated the folder structure and copied over the decorators.php file into the child theme.

pro-child/cornerstone/includes/elements/decorators.php

I then made change to the search aria label from “Toggle Dropdown Content” to just “Search” so that the screen reader can read it as search for the user. On refreshing the page, the change was not propagated. It was reading the decorators from the parent theme folder structure.

Is this not possible for such files?

Hi @dshakya,

Regretfully this is not possible. Adding that to an element will require editing cornerstone core files which is not recommended and is outside the scope of support that we offer.

Thank you for your understanding.

OK thanks. I will have to edit the parent theme files then and after each update. Wish this was presented as an option on the designer for the element.

Hi Deepak,

You’re welcome. You might also try to add it via custom JS. Targeting the element via JS mean you might not need to update after every theme updates.

Hope this helps.

1 Like

Hi @Lely,

Thanks for the tip. Adding JS in the header builder solved it. Thanks!

 document.getElementById("search-tool-anchor-toggle").setAttribute("aria-label", "Search");

Many thanks again.

Glad we could help,

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.