Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted March 20Mar 20 Hi, I am trying to fix Largest contentful paint element. Where to edit Wallpaper Carousel Widget template?
March 20Mar 20 You cannot directly edit templates on version 5. Please could you provide more information on exactly what you are trying to do?
March 20Mar 20 Author I want to add a few attributes to the <img> in Images WidgetAttributes: width, height and fetchpriority
March 20Mar 20 You would indeed need modification for that. Maybe something like using javascript to replace that element with what you need (certainly not my area of expertise)
March 21Mar 21 Author I will try that way. Where to access the default template? (it was easier on the V4)
March 21Mar 21 Author I tried this and it worked.document.addEventListener('DOMContentLoaded', function() { document.querySelectorAll('img').forEach(img => { img.setAttribute('fetchpriority', 'high'); }); });
Monday at 06:19 AM3 days Author That code will update all images, not just the ones inside the widget.Yes, you are correct. One can customize it further for whichever image they want.