Page
of 2

[free code] Enjin API Gallery - LightGallery Combo

12 replies
Posts:
4,747
Likes:
+2,691
Master
LEVEL 5
Screen+Shot+2018-04-02+at+12.51.57+AM_1522645047.png
Using the Enjin API, we can make some pretty cool gallery pages. In addition to displaying the gallery content the way we want, we can also link it into the famous LightGallery plugin:http://sachinchoolur.github.io/lightGallery/demos/index.html

My version of the Light Gallery plugin uses the base confguration + the thumbnails. In your version, you can opt out of the thumbnails.js if you wish (this only removes the pagination in the image popup view, not the actual selectable images). Of course one could expand further into a different gallery style, if in demand I will post solutions to those said requests as LG has many options (and can even display videos etc).

Installation (Enjin API)

1) Admin > Settings > API > Create Key (copy id for later)
2) Select the key and enable these methods:

- Gallery.getAlbum
- Gallery.getAlbums

Installation (Files)

1) Download the attached lightgallery.zip file (you must be logged in to see this attachment)
2) Upload those files to your site
3) We will need to link to these later

Installation (Module)

1) Create an HTML module
2) Edit the module > Select the HTML tab
3) Copy the text from the attached module.txt and paste this into the HTML source window
4) You will need to edit these link areas (you uploaded these files) :

Copy
<link type="text/css" rel="stylesheet" href="LIGHTGALLERY.CSS" /> <script src="LIGHTGALLERY.JS"></script> <script src="OPTIONAL lg-thumbnail.js FILE URL"></script>




5) You will need to edit this variable (this is the API key you got earlier, enter in between the quotations) and your current site:


Copy
var enjin_api = 'ENTER API KEY'; var my_site = 'http://mysite.com';



5) Save the module

This will now pull every gallery album on your site and display it. This page is also mobile responsive if you have a responsive site.
Screen+Shot+2018-04-02+at+12.51.57+AM_1522646260.png
Screen+Shot+2018-04-02+at+12.52.07+AM_1522646299.png
Screen+Shot+2018-04-02+at+12.51.47+AM_1522647014.png
Here is a temporary link to the example here:http://atslayer.enjin.com/apigallery
Here are the unmodified regular gallery modules that I use for uploading images:http://atslayer.enjin.com/apigalleryadmin

Notes:

- The api gallery does not have commenting or edit features, we use the module for that on a separate admin page.

- The image displays in this scenario use background images to force dimensions in a crop format rather than stretching the images themselves. If you decide to use the images instead, you are free to do so (I left the images in the code and hid them).

As always, post any issues here (or success).
Attached Files
You must login to download files.

Posted Apr 1, 18 · OP · Last edited May 12, 18 by AT SLAYER
Like
x 2
x 2
Disagree
x 1
x 1
Love it
x 1
x 1
List
Undo
Posts:
47
Likes:
+12
Just Started
LEVEL 1
this is not working on my site
Posted May 10, 18
Posts:
4,747
Likes:
+2,691
Master
LEVEL 5
Do you have a test page that I can check? I do use this actively on many sites(and the test page version runs) so there is likely an error with my module install code or your installation.
Posted May 10, 18 · OP · Last edited May 10, 18 by AT SLAYER
Posts:
47
Likes:
+12
Just Started
LEVEL 1
i can put it on a test page
Posted May 11, 18
Posts:
4,747
Likes:
+2,691
Master
LEVEL 5
Link when possible and I can check.
Posted May 11, 18 · OP
Posts:
47
Likes:
+12
Just Started
LEVEL 1
here is link to check for me
Posted May 12, 18
Posts:
4,747
Likes:
+2,691
Master
LEVEL 5
Updated the module.txt -> see 1.1 version. Specifically, there was a variable that I use on my test site but not on yours. I have added this variable in the new module version (var my_site). Try again with the new module version, install and send a link if it does not work.
Posted May 12, 18 · OP
Posts:
47
Likes:
+12
Just Started
LEVEL 1
Thank for the update it works now
Posted May 12, 18
Posts:
47
Likes:
+12
Just Started
LEVEL 1
how do you upload to this gallery
Posted May 12, 18
Posts:
4,747
Likes:
+2,691
Master
LEVEL 5
You need a gallery admin page with the module.
Posted May 12, 18 · OP
Page
of 2
Social Media
Follow us on our social media!
You will receive information, news, sneak peaks, giveaways and more!
NoticeNotices