We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20909
    • 19 Posts
    Perhaps you know the Gallery-Script (E)2 Photo Gallery (http://www.e2interactive.com).

    I thought it would be great to simply integrate this gallery-script to MODx. So I’m not very experienced with programming, I thought of it as a challenge.

    What I wanted, was a gallery for EACH Document. So the user should easily manage and upload Photos to a kind of document-gallery.
    This gallery should also only show up on specific templates selected for the document.
    And with a quite simple checkbox as TV, the user should turn the gallery on and off like he/she wants.

    So it wasn’t enough to simply make a snippet, because I thought it would be a good idea if the user can upload and manage the photos of the gallery from within the document, therefore I made
    * a plugin
    * a snippet
    * a TV

    :::::::::::::::

    The Plugin:
    It checks if there already exists a gallery (actually its only a specific folder for each document where the photos and thumbnails are placed).
    If yes, the plugin places a link to the manager of the gallery.
    If not, the plugin places a link to the upload-manager of the gallery.
    It’s quite simple, it just makes a link to the upload-script of (E)2 Photo Gallery or a small self-made script for showing the images of the (E)2 Photo Gallery.

    :::::::::::::::

    The Snippet:
    Its only a smiple call the the snippet, without (many) options yet.
    It creates the gallerycode if the TV is checked AND the gallery exists for this document.

    :::::::::::::::

    The TV:
    Its just a checkbox:

    Variable Name: e2galleryCheck
    Input-Type: Checkbox
    Input-Option-Values: Activate

    :::::::::::::::

    Install:
    Download the ZIP and extract it.
    Open config.php and eventuelly change it to mach with you behaviour.
    Upload the folder e2_gallery to assets/snippets/.
    Create the TV as mentioned in createTV.txt
    Create the Snippet as mentioned in createSnippet.txt
    Create the Plugin as mentioned in createPlugin.txt
    IMPORTANT: You have to add the following lines into the header of you template(!) (as written in an earlier post, I don’t know if it is possible to manipulate the header of MODx directly with a snippet):

    <!-- USED FOR (E)2 PHOTO GALLERY -->
    <link rel="stylesheet" type="text/css" href="./assets/snippets/e2_gallery/css/e2.css" title="default" />
    <link rel="alternate stylesheet" type="text/css" href="./assets/snippets/e2_gallery/css/e2photo_black.css" title="black" />
    <link rel="alternate stylesheet" type="text/css" href="./assets/snippets/e2_gallery/css/e2photo_gray.css" title="gray">
    <link rel="alternate stylesheet" type="text/css" href="./assets/snippets/e2_gallery/css/e2photo_lightgray.css" title="lightgray">
    <link rel="alternate stylesheet" type="text/css" href="./assets/snippets/e2_gallery/css/e2photo.css" title="none">
    <style type="text/css">
    body{text-align:center;font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;}
    img{border:none;}
    </style>
    <!-- END USED FOR (E)2 PHOTO GALLERY -->

    If you did not install/upload the gallery to assets/snippets/e2_gallery, you will have to change this in the href.

    That’s it.

    Try to create a new document or edit an existing document, eventually with the specified template in config.php, and see if you find the link to manage the document-gallery at the buttom of the page.
    Make a call to the snippet [[e2gallerySnippet]] in the document, if you have not "hard-coded" it into the template.

    Try it and play a little bit around with it.

    :::::::::::::::

    What has NOT beeon done yet:
    * Internationalization
    * Customizing with the snippet-call
    * Perhaps other things you know?

    :::::::::::::::

    I would be glad if someone tries this script just for fun and tells me what he/she thinks about it and what could be done even better.

    Hope you enjoy it!
      • 20909
      • 19 Posts
      Happy Easter!

      I see that 10 people have downloaded it, I would like to thank you for it! Hope you enjoy it and can use it for something.

      But as said, it would make me really glad to get some comments on this plugin/snippet! So I know what can be made better or perhaps someone else wants to tweak it and make som additional changes on the code?

      Regards,
      name
        • 1800
        • 52 Posts
        Im trying to get this to work...

        in index.php it has

        <?php
        	require_once $modx->config['base_url'].'assets/snippets/e2_gallery/config.php';
        	require_once $modx->config['base_url'].'assets/e2_gallery/getfolders.php';
        ?>


        but in the documentation it dosnt talk about an "assets/e2_gallery" even being there?


        I REALLY want this to work... I loath lightbox and to have something like this will be wonderful.

        Thanks for your hard work on this... ill let you know my progress.
          Minneapolis Web Design <-- where i work
          MODx Templates <-- new project im working on
          • 20909
          • 19 Posts
          Hello!

          Sorry for the very LATE answer on your question sad

          Hope you already have made it work.

          Otherwise I will try to help you.

          Have you uploaded the folder e2_gallery from this zip to /assets/snippets ?

          Well I don’t know why you get:

          <?php
          	require_once $modx->config['base_url'].'assets/snippets/e2_gallery/config.php';
          	require_once $modx->config['base_url'].'assets/e2_gallery/getfolders.php';
          ?>


          it should be
          <?php
          	require_once $modx->config['base_url'].'assets/snippets/e2_gallery/config.php';
          	require_once $modx->config['base_url'].'assets/snippets/e2_gallery/getfolders.php';
          ?>



          It seems to be a failure in the SNIPPET.

          Make sure it is right in the snippet or just copy and paste the source from the createSnippet.txt of this zip to the snippet again.


          You are welcome to ask if you still get an error (also as I mentioned I’m not very experienced in programming smiley)
            • 1800
            • 52 Posts
            Thanks... ill see how this goes and get back to you on how it goes... its been a project in the back Ive been working on.
              Minneapolis Web Design <-- where i work
              MODx Templates <-- new project im working on
              • 13540
              • 1 Posts
              Hi!
              I have a problem, I can’t see the links to manage the document-gallery at the buttom of the page. Is inside the manager ? sad