Sancho
(Sancho Rod.)
February 11, 2024, 12:10pm
1
Hi,
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!
memetican
(Michael Wells)
February 11, 2024, 6:56pm
2
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
Sancho
(Sancho Rod.)
February 11, 2024, 7:14pm
3
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.
1 Like