We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    This is an auto-generated topic for <a href="http://modxcms.com/extras/package/642">Gallery 0.1-alpha1</a> by splittingred.

    Brief Description:
    Gallery is a dynamic Gallery Extra for MODx Revolution. It allows you to quickly and easily put up galleries of images, sort them, tag them, and display them in a myriad of ways in the front-end of your site.



    - Note: This is in alpha, so you might find bugs. But it should work as expected.



    See the official documentation here: <a href="http://svn.modxcms.com/docs/display/ADDON/Gallery">http://svn.modxcms.com/docs/display/ADDON/Gallery</a>
      • 8522
      • 145 Posts
      Hi

      I’m really exited about this addon. I installed Gallery-Alpha-1 on MODx Revolution 2.0.0-beta-5 traditional via Package Management.

      I can’t create a new Album under Components / Gallery.
      The modal window with Name, Description, Acitve, Prominent appears but after entering a Name and then save, "please wait" appears quickly but the modal window remains. I got following JavaScript Error:

      r is undefined
      [Break on this error] if (r.errors !== null && frm) {  modx.js (line 290)


      Possible not working in Beta-5?
        • 28215
        • 4,149 Posts
        eerne,

        A few things: did a Resource appear in your site tree called "Gallery Connector"?
        If so, can you check to see if the setting "gallery.connector_resource" is set to the ID of that resource?

        If yes, then load up the Gallery component, and there should be some JS like:

        GAL.config.connector_url = '/url/here.html';


        or something of the sort. Can you make sure that URL points to that resource mentioned above?
          shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
          • 8522
          • 145 Posts
          Hi Splittingred

          On installation it created a new resource "Gallery Connector" (24) with the content: [[!GalleryConnector]]. The first thing I did after installation was moving "Gallery Connector" into a different context.

          My setup is maybe a little bit weird: I have modx installed in sub.mydomain.ch/modx/ and created a new context for in www.mydomain.ch/ that i named "main".

          here the js from manager / components / gallery

          <script type="text/javascript">
          Ext.onReady(function() {
              GAL.config = {
              	"assetsUrl":"\/modx\/assets\/components\/gallery\/",
              	"cssUrl":"\/modx\/assets\/components\/gallery\/css\/",
              	"jsUrl":"\/modx\/assets\/components\/gallery\/js\/",
              	"imagesUrl":"\/modx\/assets\/components\/gallery\/images\/",
              	"connectorUrl":"http:\/\/www.mydomain.ch\/gallery-connector.html",
              	"corePath":"\/home\/httpd\/vhosts\/mydomain.ch\/subdomains\/sub\/httpdocs\/modx\/core\/components\/gallery\/",
              	"modelPath":"\/home\/httpd\/vhosts\/mydomain.ch\/subdomains\/sub\/httpdocs\/modx\/core\/components\/gallery\/model\/",
              	"chunksPath":"\/home\/httpd\/vhosts\/mydomain.ch\/subdomains\/sub\/httpdocs\/modx\/core\/components\/gallery\/elements\/chunks\/",
              	"pagesPath":"\/home\/httpd\/vhosts\/mydomain.ch\/subdomains\/sub\/httpdocs\/modx\/core\/components\/gallery\/elements\/pages\/",
              	"snippetsPath":"\/home\/httpd\/vhosts\/mydomain.ch\/subdomains\/sub\/httpdocs\/modx\/core\/components\/gallery\/elements\/snippets\/",
              	"processorsPath":"\/home\/httpd\/vhosts\/mydomain.ch\/subdomains\/sub\/httpdocs\/modx\/core\/components\/gallery\/processors\/",
              	"hooksPath":"\/home\/httpd\/vhosts\/mydomain.ch\/subdomains\/sub\/httpdocs\/modx\/core\/components\/gallery\/hooks\/",
              	"useCss":true,
              	"loadJQuery":true
              };
              GAL.config.connector_url = "http://www.mydomain.ch/gallery-connector.html";
              GAL.request = {"a":"72"};
          });
          </script>
          

          looks all good to me.

          http://www.mydomain.ch/gallery-connector.html gives a json list

          {"success":false,"message":"No action specified.","total":0,"data":[],"object":[]}


          seems fine.

          when loading manager / components / gallery I can see two request in firebug, they are both 200 OK from http://www.mydomain.ch/gallery-connector.html

          OUPSY:

          I just did a test an moved gallery-connector.html back to the web context which is at sub.mydomain.ch/modx/ AND I can create new Albums now!!!!!!! So I guess gallery-connector has to be in web context. not in my custom context. Is that correct? I personally don’t really mind where it is.

          What is the reason for gallery-connector?

          Is this the URL where we can fetch json data for creating js Galleries? (If yes should the content type be json?)

          Looking more into it this week. Thanks for you quick response!
          Have a nice weekend
          eni
            • 28215
            • 4,149 Posts
            Quote from: eerne at Feb 06, 2010, 09:34 PM

            I just did a test an moved gallery-connector.html back to the web context which is at sub.mydomain.ch/modx/ AND I can create new Albums now!!!!!!! So I guess gallery-connector has to be in web context. not in my custom context. Is that correct? I personally don’t really mind where it is.
            It’s probably because you’re doing a cross-domain XHR (AJAX) request, which the browser wont let you do for security reasons. You’ll have to keep the connector in the same (sub)domain as the mgr.

            What is the reason for gallery-connector?
            It acts as an AJAX gateway for the Gallery’s custom manager page UI.

            Is this the URL where we can fetch json data for creating js Galleries? (If yes should the content type be json?)
            Yes and no; doing straight AJAX requests or fetches will require MODx session auth, so it’s a bit more complex than that, but theoretically, I’m sure you could.

            The content type should be text/json, unless there’s a file being sent (text/json seems to error in certain browsers or with ExtJS with files sent with it).


            Have a nice weekend
            You too!
              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
              • 17499 ☆ A M B ☆
              • 872 Posts
              Quote from: splittingred at Feb 06, 2010, 09:55 PM

              What is the reason for gallery-connector?
              It acts as an AJAX gateway for the Gallery’s custom manager page UI.

              Why did you choose to use a document as Ajax connector instead of a file in the assets directory?
                • 8522
                • 145 Posts
                Thanks for the explanation this is all new to me and the first component with custom manager ui that I’m trying, and very exiting smiley

                I’m no expert, but cross domain XHR should be possible with jsonp. I found an extjs example fetching images from flickr, it is using an addition script, licensed under MIT.
                http://www.extjs.com/playpen/ext-core-latest/examples/jsonp/

                Though if it is only used for manager ui it doesn’t matter.
                  • 28215
                  • 4,149 Posts
                  Quote from: lossendae at Feb 07, 2010, 03:45 AM

                  Why did you choose to use a document as Ajax connector instead of a file in the assets directory?

                  Great question. We wrestled with this for a while, but the eventual reason was simple: limit access points. Why allow another php file access point, when a MODx Resource can do the trick? And there’s benefits to using the resource - namely, you can apply even more fine-grained access permissions to it.

                  Plus, if someone doesnt want it in the tree - just create a new ’services’ context, and load the context from a subdirectory (similar to how you’d do subdomains).
                    shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                    • 27022
                    • 47 Posts
                    I’m new to the world of MODx, and i’m trying to cut my teeth in revolution. I know it’s still a beta, but i’m trying to learn the latest...

                    I’m using this gallery component, and I finally figured out how to get it working, however, i’m attempting to add a rel tag to the output in order to use a lightbox-esque js plugin for my images. What I did was change the galItemThumb chunk to
                    <div class="gal-item [[+cls]]">
                        <a href="[[+image]]" rel="fancybox">
                            <img class="[[+imgCls]]" src="[[+thumbnail]]" alt="[[+name]]" />
                        </a>
                    </div>
                    , and then I saved it then cleared the cache, to no avail. When I refreshed my gallery page, the images had disappeared, and they aren’t in the source. Is adding it to the chunk what i am supposed to do to achieve this?

                    I have the jquery, lightbox plugin, and lightbox css linked up properly in the template i’m using, and i’ve got
                    [[!Gallery? &album=`Gallery`]]
                    in my document, which is properly outputting the gallery.

                    Another problem i’m having is when i add the
                    &tag=`one of my tags`
                    to my code, and save, it doesn’t save the change. Any suggestions?
                      • 28215
                      • 4,149 Posts
                      Quote from: shick11sp at Feb 09, 2010, 11:42 AM

                      and then I saved it then cleared the cache, to no avail. When I refreshed my gallery page, the images had disappeared, and they aren’t in the source. Is adding it to the chunk what i am supposed to do to achieve this?

                      Create a new chunk, (lets say ’myGalThumb’) and then do the tag like this:

                      [[!Gallery? &album=`Gallery` &thumbTpl=`myGalThumb`]]
                      



                      Another problem i’m having is when i add the
                      &tag=`one of my tags`
                      to my code, and save, it doesn’t save the change. Any suggestions?
                      By "it doesnt save the change", what do you mean? Do you mean the Resource isn’t saving? The tag code? Or the front-end output? Did you try clearing the cache? Is the tag correctly typed? Can I see the full tag?
                        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com