How can I add static text to dynamic title attribute


I want to use the title attribute for dynamic links and add static text to the value from the collection. The interface only allows the selection of a value or a static text, but not its combination.
Example: Restaurants in < Name >

Is there a way to achieve this?

Thanks in advance!

Custom code.
You could set title as above, and then have it modified by JS to add the prefix.

e.g. if those elements had a class name of stadt it could be-

document.querySelectorAll('.stadt').forEach(element => {
    const currentTitle = element.getAttribute('title');
    element.setAttribute('title', `Restaurants in ${currentTitle}`);
1 Like

Thanks again, Michael!

In the meantime I solved it by copying the HTML of the badge into an embed element (inside the collection) and combined variables/static text there.