I’m trying to create an image gallery as a portfolio of work i’ve done, so i’m hoping to be able to add a caption to every image, but that’s not possible in Ghost. I’ve seen other posts about this limitation, but i’ve not found anything telling of a workaround or some other host/provider I could use and then embed a gallery instead.
I also found this very useful, thank you! At the moment, it meets my needs a bit better than the gallery cards with their 9 image limit.
I have some technical questions that I’d appreciate anyone’s help with:
The images align unpredictably (always the first item, sometimes others) unless I have a caption beneath them. Any thoughts on why? I know your grid solution is best suited to images with consistent aspect ratios, but I’d like to understand why mixed aspect ratios only work in certain circumstances
Is there a CSS code injection solution for adding borders to these images, instead of using the editor in each image card? This would be faster, and also, I notice that saving the border makes it a permanent part of the thumbnail, which can be overwritten but not undone. I’d like to avoid editing and updating each image.
Or, more broadly, how do I go about discovering selectors for elements so I can modify them with CSS via code injection? I’m (clearly) new to all this, and I don’t know how to formulate the right search terms, etc.
The alignment weirdness is the result of non-first images having some extra padding or margin. It’ll probably be pretty clear when you get it open in dev tools.
If, on the other hand, you’d like to add borders selectively (either to individual images or to all images in a specific gallery), start off by adding this to your code injection:
Having done that, wrap any images or galleries you want to have borders with HTML cards. Place the following code in an HTML card preceding the image/gallery:
<div class="image-border">
And place the following code in an HTML card proceeding the image/gallery:
</div>
If you want to make the latter process a bit easier, you can create snippets out of the two HTML cards.