can i change the tag
is it possible to add € before the numbers and delete the and instead of comma i want to have a ‘-’
and change the numbers to thousands with a dot in between
can i change the tag
is it possible to add € before the numbers and delete the and instead of comma i want to have a ‘-’
and change the numbers to thousands with a dot in between
Hey @aardigamsterdam! Some custom code might be needed! Please share your link
Can you test this code?
<script>
window.fsAttributes = window.fsAttributes || [];
window.fsAttributes.push([
'cmsfilter',
(filterInstances) => {
console.log('cmsfilter Successfully loaded!');
const [filterInstance] = filterInstances;
filterInstance.listInstance.on('renderitems', (renderedItems) => {
// Select all elements that contain the text "Prijs "
let elements = document.querySelectorAll('[fs-cmsfilter-element="tag-template"]');
// Iterate through the selected elements
elements.forEach(function (element) {
let tagTextElement = element.querySelector('[fs-cmsfilter-element="tag-text"]');
let textContent = tagTextElement.textContent;
// Check if the text content contains "Prijs "
if (textContent.includes('Prijs')) {
// Use regular expression to find and replace numbers with € + numbers
textContent = textContent.replace(/\b(\d+)\b/g, '€$1');
// Update the element's text content
tagTextElement.textContent = textContent;
}
});
});
},
]);
</script>