# Tiles Image Gallery

**URL:** https://meta.discourse.org/t/tiles-image-gallery/81950
**Category:** Theme component
**Tags:** deprecated
**Created:** [March 2, 2018, 6:56am UTC](https://meta.discourse.org/t/tiles-image-gallery/81950 "2018-03-02T06:56:34Z")
**Posts on this page:** 20
**Page:** 1

<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: [March 2, 2018, 6:56am UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/1 "2018-03-02T06:56:34Z")

</div>

⚠ This component is deprecated. Discourse now has a built-in tiled gallery feature:

> [@Introducing image grids in posts](https://meta.discourse.org/t/introducing-image-grids-in-posts/268664):
>
> If you have many images in a Discourse post, you can now have them automatically arranged into a nice grid. All you need to do is wrap them in [grid] ... [/grid] tags, and the images will be neatly arranged. This is a core feature as of [this commit](https://github.com/discourse/discourse/commit/f89b5680cb4cc28003133e0095393b78d4b87460), enabled on all Discourse instances. Here’s an example in action:

* * *

Responsive Grid Galleries!

 ![Capture](https://global.discourse-cdn.com/meta/original/3X/2/b/2b9d0b16e0eb32cf72afcf0e0cbcd604e28bb2a8.jpg) ![Capture2](https://global.discourse-cdn.com/meta/original/3X/8/9/898536d985ff3b3819786de57222a98c2d2dca42.jpg)

  

 ![Capture3](https://global.discourse-cdn.com/meta/original/3X/a/f/af2ec16d2ca127099ceeee9f4fcb23dae9922bf8.jpg) ![Capture44](https://global.discourse-cdn.com/meta/original/3X/e/a/ea410d869fa1b2e668475fcc8c97863350a10756.jpg) ![Capture4](https://global.discourse-cdn.com/meta/original/3X/e/2/e2c06edd3d45b23e373749809a047e926a7daebf.jpg)

* * *

Built using [David Desandro](https://github.com/desandro)’s open source [Masonry](https://masonry.desandro.com/) and [ImagesLoaded](https://imagesloaded.desandro.com/) libraries - [MIT license](https://desandro.mit-license.org/)

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

* * *
#### How do I use this? 

This component adds a button to the composer.

 ![Untitled](https://global.discourse-cdn.com/meta/original/3X/f/9/f9ff84e7fcdc01634e77c6248bfa0b9ab09742ba.png)

So all you have to do is:

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

 ![Capture6](https://global.discourse-cdn.com/meta/original/3X/5/3/534daf36de827ac6934219830923aedc595306ad.PNG)

2- Click the gallery button.

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

 ![Capture8](https://global.discourse-cdn.com/meta/original/3X/f/7/f72dfce1742410ca46731a24336706f6aca19f93.PNG)

Done!

* * *

#### 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:

 ![Capture5](https://global.discourse-cdn.com/meta/original/3X/a/7/a7d4afec515e56c1ba91d59b7998bdd819688e1f.jpg)

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.**

 ![Capture9](https://global.discourse-cdn.com/meta/original/3X/0/a/0a67632575a5971e0b63e8398ab711d38de44a2e.jpg)

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

You better believe it! 😄

 ![Capture999](https://global.discourse-cdn.com/meta/original/3X/a/1/a1b14744165035f183b7473e81e094052628ac84.jpg)

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

Like this:

 ![Capture](https://global.discourse-cdn.com/meta/original/3X/d/6/d6b7f2957b6486135d00c0b2ff72180a9c019c40.PNG)

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: 😋

@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. 🍷

| | | |
| --- | --- | --- |
| 🛠 | **Repository** | [github.com/discourse/Discourse-Tiles-Image-Gallery](https://github.com/discourse/Discourse-Tiles-image-gallery) |
| 📖 | **New to Discourse Themes?** | [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) |

Install this theme component

---

<div class="post-metadata">

### Author: ![kaefert](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kaefert/32/119996_2.png) [@kaefert](https://meta.discourse.org/u/kaefert)
#### Post date: [March 10, 2018, 12:55pm UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/2 "2018-03-10T12:55:26Z")

</div>

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

---

<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: [March 10, 2018, 2:06pm UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/3 "2018-03-10T14:06:07Z")

</div>

That’s a very good point @kaefert thank you for bringing it up 🌻  
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:

> [@lll](#):
>
> Can I use both Slick and Tiles at the same time?  
> You better believe it! 😄

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:

 ![Capture](https://global.discourse-cdn.com/meta/original/3X/0/8/08cc31126e37caec4df356300c85993727ec8509.PNG)

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

[![](https://global.discourse-cdn.com/meta/original/3X/a/1/a1b14744165035f183b7473e81e094052628ac84.jpg) ](https://global.discourse-cdn.com/meta/original/3X/a/1/a1b14744165035f183b7473e81e094052628ac84.jpg)

---

<div class="post-metadata">

### Author: ![kaefert](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kaefert/32/119996_2.png) [@kaefert](https://meta.discourse.org/u/kaefert)
#### Post date: [March 10, 2018, 2:35pm UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/4 "2018-03-10T14:35:12Z")

</div>

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.

 ![Screenshot%20from%202018-03-10%2015-33-32_crop](https://global.discourse-cdn.com/meta/original/3X/8/a/8a3567fa35dee50c8d8fd9cd73a5d01e05d2e4db.png)

---

<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: [March 10, 2018, 2:49pm UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/5 "2018-03-10T14:49:47Z")

</div>

> [@kaefert](#):
>
> 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.

I understand 👌

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

Like this:

 ![Capture](https://global.discourse-cdn.com/meta/original/3X/d/6/d6b7f2957b6486135d00c0b2ff72180a9c019c40.PNG)

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.

---

<div class="post-metadata">

### Author: ![savas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/savas/32/131277_2.png) [@savas](https://meta.discourse.org/u/savas)
#### Post date: [March 19, 2018, 10:35am UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/6 "2018-03-19T10:35:23Z")

</div>

Bugs\*

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/d/ad64e96a65e6953ae59e66be2523eb9ce9d78ee8.jpg)

---

<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: [March 19, 2018, 11:15am UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/7 "2018-03-19T11:15:45Z")

</div>

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

```plaintext
.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?

---

<div class="post-metadata">

### Author: ![savas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/savas/32/131277_2.png) [@savas](https://meta.discourse.org/u/savas)
#### Post date: [March 19, 2018, 11:17am UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/8 "2018-03-19T11:17:40Z")

</div>

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

---

<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: [March 19, 2018, 11:21am UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/9 "2018-03-19T11:21:17Z")

</div>

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

 ![image](https://global.discourse-cdn.com/meta/original/3X/6/4/64dff560b7c63a2c11c20374ec3427e2ac558437.png)

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

---

<div class="post-metadata">

### Author: ![kaefert](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kaefert/32/119996_2.png) [@kaefert](https://meta.discourse.org/u/kaefert)
#### Post date: [March 27, 2018, 10:30am UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/10 "2018-03-27T10:30:38Z")

</div>

Both the [Slick theme component](https://meta.discourse.org/t/slick-gallery-component/81952/4) and this one don’t seem to work after upgrading discourse to 2.0.0.beta5. JS Error messages for this one:

```plaintext
I18n.translations.en.js.composer is undefined
@https://discourse-instance/:104:2
O@https://discourse-instance/assets/application-d85c1a58a506702e3c09017c9d92a23100e1ec3c2a620a10440601587bf2d226.js:13:23523
initialize@https://discourse-instance/assets/application-d85c1a58a506702e3c09017c9d92a23100e1ec3c2a620a10440601587bf2d226.js:6:8870
runInstanceInitializers/<@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:8:23844
n</e.prototype.each@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:8:8774
n</e.prototype.topsort@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:8:8272
t</e.prototype.topsort@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:8:7670
_runInitializer@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:8:24023
runInstanceInitializers@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:8:23786
_bootSync@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:8:11232
didBecomeReady@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:8:17098
invokeWithOnError@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:19387
flush@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:19832
flush@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:20592
end@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:20937
run@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:22006
join@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:22126
u.join@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:13:3164
u.bind/<@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:13:3370
p@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:2:9019
o/</f<@https://discourse-instance/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:2:9324

```

---

<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: [April 3, 2018, 7:37am UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/11 "2018-04-03T07:37:45Z")

</div>

Hi @kaefert, @vchrizz and thank you for reporting 🌻

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.

 ![Capture](https://global.discourse-cdn.com/meta/original/3X/b/4/b4ce5c9ff216509530caead6f4d49b36e4e15846.jpg)

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](https://meta.discourse.org/t/how-do-you-force-a-script-to-refire-on-every-page-load-in-discourse/74856/26).

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.

---

<div class="post-metadata">

### Author: ![kaefert](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kaefert/32/119996_2.png) [@kaefert](https://meta.discourse.org/u/kaefert)
#### Post date: [April 3, 2018, 8:19am UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/12 "2018-04-03T08:19:31Z")

</div>

> [@lll](#):
>
> Are you still facing the same problem?

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

Thanks for your help!

---

<div class="post-metadata">

### Author: ![LKNickname](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lknickname/32/209114_2.png) [@LKNickname](https://meta.discourse.org/u/LKNickname)
#### Post date: [April 25, 2018, 10:02am UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/13 "2018-04-25T10:02:31Z")

</div>

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.

 ![2018-04-25%2012_01_21-Administration%20-%20Kneipentruppe%20-%20Forum](https://global.discourse-cdn.com/meta/original/3X/2/c/2c162e76ec8e76e26085a7f9ce0c9bc7961a82b5.png)

---

<div class="post-metadata">

### Author: ![LKNickname](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lknickname/32/209114_2.png) [@LKNickname](https://meta.discourse.org/u/LKNickname)
#### Post date: [April 25, 2018, 10:03am UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/14 "2018-04-25T10:03:05Z")

</div>

(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?

 ![2018-04-25%2012_01_07-Kneipentruppe%20-%20Forum](https://global.discourse-cdn.com/meta/original/3X/0/6/06b9294492861753e030ae0ecfa8e50d8cd60723.jpg)

---

<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: [April 25, 2018, 10:04am UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/15 "2018-04-25T10:04:42Z")

</div>

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

---

<div class="post-metadata">

### Author: ![LKNickname](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lknickname/32/209114_2.png) [@LKNickname](https://meta.discourse.org/u/LKNickname)
#### Post date: [April 25, 2018, 10:19am UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/16 "2018-04-25T10:19:42Z")

</div>

![2018-04-25%2012_19_14-Kneipentruppe%20-%20Forum](https://global.discourse-cdn.com/meta/original/3X/9/2/92eb385b64f5f92a4614c08385cd1bfbd39e6aba.png)

---

<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: [April 25, 2018, 10:22am UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/17 "2018-04-25T10:22:34Z")

</div>

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

---

<div class="post-metadata">

### Author: ![LKNickname](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lknickname/32/209114_2.png) [@LKNickname](https://meta.discourse.org/u/LKNickname)
#### Post date: [April 25, 2018, 10:25am UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/18 "2018-04-25T10:25:33Z")

</div>

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

 ![2018-04-25%2012_24_20-Kneipentruppe%20-%20Forum](https://global.discourse-cdn.com/meta/original/3X/0/3/0321db46ff765ac99432c5ff2d2705c552c997ce.png)

---

<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: [April 25, 2018, 10:27am UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/19 "2018-04-25T10:27:43Z")

</div>

Ok, try it again one last time 🌻. 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**

Crosspost:

> [@Slick Image Gallery](https://meta.discourse.org/t/slick-gallery-component/81952/7):
>
> There was a small update today that fixes the translation error for good! If you’re on beta 7 and face any errors, please update the theme. sunflower

---

<div class="post-metadata">

### Author: ![LKNickname](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lknickname/32/209114_2.png) [@LKNickname](https://meta.discourse.org/u/LKNickname)
#### Post date: [April 25, 2018, 10:28am UTC](https://meta.discourse.org/t/tiles-image-gallery/81950/20 "2018-04-25T10:28:46Z")

</div>

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

[Next page](https://meta.discourse.org/t/tiles-image-gallery/81950.md?page=2)
