Tiles Image Gallery

Responsive Grid Galleries!

Built using David Desandro’s open source Masonry and ImagesLoaded libraries - MIT license

" … released under the MIT license. Have at it."

#### How do I use this?

This component adds a button to the composer.

So all you have to do is:

1- Upload a bunch of images using the default Discourse upload button then highlight the code:

2- Click the gallery button.

You will get a static preview of the the selected images in the preview pane:


Anything else I need to know?

This component does not have any color / background styles in it. It will inherit the current theme’s styles.

Here’s the theme component running on a different theme:

This theme component also maintains the default Discourse lighbox behavior, this means that clicking any of the images will open them in the native lightbox viewer.

Can I use both Slick and Tiles at the same time?

You better believe it! :smile:

This is possible by making both slick and tiles components of a theme.

Like this:

You can then make “my theme” in the example above the default theme or make it user-selectable and it would include both Slick and Tiles.

A big thank you to everyone that helped along the way: :yum:

@Dax - Composer button
@cpradio - Button translations
@Mittineague - ajaxComplete handler
@simon - api.onPageChange handler
@vinothkannans - Topic page url regex
@sam - adding data-theme-* to whitelisted attributes

Bug reports / Suggestions / PRs welcome. :wine_glass:

Install this theme component


You demonstrated that both Slick & Tiles theme can be used at the same time, but did not explain how. Could you please? (explain how)

1 Like

That’s a very good point @kaefert thank you for bringing it up :sunflower:
I will edit both the Slick and Tiles topics and clarify what I meant.

In the meantime, to answer your question:

Tile and Slick act independently. What I meant to say here:

is that there is no conflict between Tiles and Slick. If you want to use both Tiles and Slick at the same time, you can! You just have to install both of them, separately.

If you install both of the same time, you get something like this in the composer:


And if you use both of them in a topic/post you end up with something like this:


The problem I have about activating both at the same time is that I only can set one as default in the admin settings, and can only select one of them in the user settings.

1 Like

I understand :ok_hand:

What you want you do is make Slick and Tiles components of your current theme instead of them being user-selectable themes.

Like this:

You can then make “my theme” in the example above the default theme or make it user-selectable and it would include both Slick and Tiles.



Thanks for reporting @savas

Can you share a little bit more details? The reason why I’m asking is because that looks like a onebox. This theme component only applies styles to images within very specific structure like so

.tiles-initialized {
 // all styles are applied here

So it should not have any effect on oneboxes at all.

Does the issue still occur if you disable the the theme temporarily?


i got installed facebook onebox plugin can he mess your plugin ?

1- The Facebook onebox plugin is not supported anymore, you don’t need it.
2- No, there should not be any conflict between the two. Tiles only targets specific images but you have to use the button in the composer to make it work


If you’re not sure, check the OP again and let me know if you need more help.


Both the Slick theme component and this one don’t seem to work after upgrading discourse to 2.0.0.beta5. JS Error messages for this one:

I18n.translations.en.js.composer is undefined
1 Like

Hi @kaefert, @vchrizz and thank you for reporting :sunflower:

My apologies for not getting to you earlier.

the good news is that I have just tested on v2.0.0.beta5 +120 and both Slick and Tiles seem to be working.

My guess is that subsequent commits to Discourse addressed the issue.

Are you still facing the same problem?

Even better news is that I tinkered a little bit with both Slick and Tiles and they now have much more targeted firing methods that will only fire when needed. Credit here goes to @vinothkannans for the awesome tip.

So if you’re using either Slick or Tiles or both, please update now and let me know if the problem is still there, or if there are any other issues that need to be addressed.


I just upgraded our Discourse instance to the latest commit and reinstalled the two themes components. Everything works again as it worked with beta4! :slight_smile:

Thanks for your help!


I am facing a Problem on beta 2.0.7.
I imported the Theme and configured it as a Child-Theme for my standard “Dark”-Theme.


(Had to split the post because I cannot include more than one image in my posts)

However I just get a blank Screen…any ideas on that?

@Lars Can you check if there are any errors in the browser console?


1 Like

Ok, thank you. Can you update the theme and check again?

1 Like

Did an Update and refreshed (cleared cache).
Seems to be the same error.


Ok, try it again one last time :sunflower:. If that does not work I’ll take a deeper look at this and fix it within the next couple of hours.

After the fact edit



That did the trick, thank you very much for the quick help :slight_smile: