# Tiles Image Gallery

**URL:** <https://meta.discourse.org/t/tiles-image-gallery/81950>\
**Category:** Theme component\
**Tags:** deprecated\
**Created:** [02.Март.2018 06:56:34 UTC](https://meta.discourse.org/t/tiles-image-gallery/81950 "2018-03-02T06:56:34Z")\
**Posts on this page:** 1\
**Showing post:** 60

<div class="post-metadata">

**Author:** ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)\
**Post date:** [28.Октябрь.2018 06:39:30 UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/60 "2018-10-28T06:39:30Z")

</div>

> [@anon36484860](#):
>
> bumping this one 🙂

Apologies, I must have missed your post.

> [@anon36484860](#):
>
> Is there any way to enable automatic generation of the tiles gallery? So that the user doesn’t have to put the tags around it (via button)? for example based on conditions like category and minimum amount of images…

In theory, this should be possible. Not long ago a very cool new feature was added to Discourse.

Theme branches ❤

[https://github.com/discourse/discourse/commit/51aba32651c67a9cdf1c8ef08d7354f6e4466251](https://github.com/discourse/discourse/commit/51aba32651c67a9cdf1c8ef08d7354f6e4466251)

So this is a good use-case to experiment with theme branches. I created a new branch of the Tiles component called `auto-tiles`

Try to import the theme again using:

`https://github.com/hnb-ku/Discourse-Tiles-image-gallery`

except this time, add `auto-tiles` as the branch name when you import the component. It should import as a separate theme component and will not affect the current Tiles theme component that you have now. If you find that the new branch is not for you, just delete the new component and everything should be back to normal.

 ![1112](https://global.discourse-cdn.com/meta/original/3X/7/2/72b695fe3ba917def579da291f640ba8af61b2e0.png)

So, what is `auto-tiles`?  
In a nutshell, it’s an experiment. I don’t recommend using this branch for reasons I’ll mention later.

The branch includes an additional setting. That setting allows you to set categories that Tiles should work on automatically.

 ![1113](https://global.discourse-cdn.com/meta/original/3X/4/d/4d91d1f0789d97e7f2933b6703b4ea0a58c14ff0.png)

**So, how does it work?**  
If a post / topic is in one of the targeted categories, **and** it has two or more adjacent lightboxes, a gallery with those images will automatically be created. You don’t need to add the tags to the composer and if one of the conditions above is not met, nothing will happen.

**So, why not add this feature to the master branch of Tiles?**  
Because of the preview in the composer. Without the tags to wrap around the images you want to target, it’s quite a task to find an efficient way to style the images in the composer preview - at least that’s how I feel about it now. They currently appear just like regular lightboxes (full width)

I don’t see myself working on that particular problem any time soon.

If you really, **really** want to have both automatic galleries and to have a proper preview of the gallery in the composer without the use of `<div>` tags, I suggest that you create a post in the #Marketplace category. I’m sure that with enough time, one of the freelancers we have here on Meta might be able to solve the problem for you.

---

_[View the full topic](https://meta.discourse.org/t/tiles-image-gallery/81950)._
