Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted February 4, 20186 yr Hello guys, I'm trying to modify my gallery theme. I just want to add a centred button under each photos. {{foreach $images as $image}} <li class='ipsGrid_span4 data-role='patchworkImage' data-json='{$image->json()|raw}'> <div data-grid-ratio='65'> <a href><img src=... alt='' class='cGalleryThumb'> </a> {{if $table->canModerate()}} [...] </div> <ul class='ipsList_inline ipsType_medium ipsClearfix'> [...] </ul> </li> <!-- WHAT I ADDED--> <li> <a href='www.google.com' class='ipsButton ipsButton_overlaid ipsButton_verySmall' title='ciao' data-ipsTooltip><i class='fa fa-download'></i></a> </li> {{endforeach}} what am I missing? do I have to create a custom css for it? Or maybe do I need to change the grid template?
February 5, 20186 yr Seems like you're over complicating things. Just add the button inside your grid item {{foreach $images as $image}} <li class='ipsGrid_span4' data-role='patchworkImage' data-json='{$image->json()|raw}'> <div data-grid-ratio='65'> <a href><img src=... alt='' class='cGalleryThumb'> </a> {{if $table->canModerate()}} [...] </div> <ul class='ipsList_inline ipsType_medium ipsClearfix'> [...] </ul> <div> <a href='www.google.com' class='ipsButton ipsButton_overlaid ipsButton_verySmall' title='ciao' data-ipsTooltip><i class='fa fa-download'></i></a> </div> </li> {{endforeach}}
February 5, 20186 yr Author I tried it, but it simply doesn't not appear on my layout. If you inspect the page there is now sign of it, except in the source elements. This is what I see after adding the button. After the div there is just the following picture.
February 5, 20186 yr When you use the 'patchwork' layout (where blocks of images are shown side by side), javascript ends up taking each image and reformatting it based on the Gallery patchwork javascript template. Basically, you won't be able to easily do this unless you write a javascript mix in (or find a way to modify the javascript template, which isn't possible through the interface). Specifically the js template or templates you would want to look at are gallery.patchwork.indexItem and gallery.patchwork.tableItem
February 5, 20186 yr Well, while developing I access them via applications/gallery/dev/js/front/templates/ips.templates.browse.js But with IN_DEV disabled, they would only be stored in core_javascript in the database (if you edited the record, you would need to clear your caches to get javascript to rebuild).
February 6, 20186 yr For future versions, maybe css-grid would be a better alternative to javascript, with a flexbox fallback for older browsers.
February 6, 20186 yr Possibly, although it doesn't actually use a grid style layout so that may not work well. We'd have to test.
Archived
This topic is now archived and is closed to further replies.