We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37286
    • 160 Posts
    Starting this thread for support and feedback on my sekFancyBox addon. Any suggestions, comments, or questions are all welcome.
      • 19872
      • 1,078 Posts
      Modx 2.2.0

      Trying to get sekFancyBox to work in MODx with NO success. I use the following call in my template:
      [[sekfancybox?
      &linktext=`Link to FancyBox`
      &text=`where is the fancy text?`
      &title=`TITLE WORKS`
      ]]

      Resulting page displays the link "Link to FancyBox". Clicking the link results in the modal box popping up with the title "TITLE WORKS" displaing below the window. All is great except that in the actual text area, rather than my text—"where is the fancy text"—appearing in the window, there is a message that reads: The requested content cannot be loaded.
      Please try again later.

      Is anyone else having this issue?
        • 19872
        • 1,078 Posts
        I created a template variable, and then modified the call to pull in the contents of the template variable.
        [[sekfancybox?
          &linktext=`Link to FancyBox`
          &text=`[[*fancyboxcontent]]`
          &title=`TITLE WORKS`
        ]]


        Some success achieved: The generated source code does indeed have the silly message that I entered into the template variable field for the resource.

        <a class="fancybox" href="#"" title="TITLE WORKS">Link to FancyBox</a><div style="display: none;"><div id="" style="width:400px;"><p>I certainly hope this shows up in the fancy box</p></div></div>


        Bad news is: The popup window still says: The requested content cannot be loaded. Please try again later.

        Firefox error console indicates: WARNING: Empty string passed to getElementById()

        If anyone has a solution, please do tell.
          • 37286
          • 160 Posts
          I am guessing you have two modal windows defined on your page. When you have multiple modals you must define a unique link property. This tells fancy box which content to display.
          [[!sekfancybox?
          &link=`modal1` 
          &linktext=`link 1` 
          &header=`header 1` 
          &title=`title 1` 
          &text=`this text will display in the window for modal 1`]]
          

          [[!sekfancybox?
          &link=`modal2` 
          &linktext=`link 2` 
          &header=`header 2` 
          &title=`title 2` 
          &text=`this text will display in the window for modal 2`]]
          
            • 19872
            • 1,078 Posts
            I only have one modal window defined on my page.

            I changed my call to:

            [[!sekfancybox?
            &link=`modal1` 
            &linktext=`link 1` 
            &header=`header 1` 
            &title=`title 1` 
            &text=`this text will display in the window for modal 1`]]


            This worked, but now my link says "link 1", and title says "title 1", etc. etc.

            Just went back to my original code and inserted just the &link-=modal 1 and all seems to be working ok.

            [[sekfancybox?
            &link=`modal1` 
              &linktext=`Link to FancyBox`
              &text=`If you're reading this, then all is working well with the add-on.`
              &title=`TITLE`
            ]]



            Thank you.

              • 37286
              • 160 Posts
              It could be a conflict with something else on the page. It is best practice to define a unique link name that is not used as an id of any other elements on a page because fancy box automatically creates a hidden element with the id you define in the link that holds your text information that is displayed in your modal window. Two elements of the same name will cause an error when displaying content.

              Glad this fixed your problem.
                • 19872
                • 1,078 Posts
                I have some js related to a drop menu, and js for calling up a webfont, but other than that the template page is bare bones.

                Certainly, using a unique link name seemed to solve the issue.

                Thank you for the speedy and effective responses. Very much appreciated.
                  • 38669
                  • 51 Posts
                  This is more a heads up since I didn't notice it, thanks Steve for pointing out the obvious.

                  If you want to move the style sheet into maybe a common CSS directory, there is a "customcss" call - it is in the documentation, but is easy to miss.
                    • 4757
                    • 64 Posts
                    I'm in no way a developer, but can usually figure stuff out but what I'm trying to do is over my head.

                    Using Revo 2.4

                    I wan to display a list of galleries with a single thumbnail to represent each gallery. When that single thumbnail is clicked then the entire gallery is loaded in sekFancyBox and the user can browse the entire gallery.

                    I have been able to get sekFancyBox to work on my page but only for a specified gallery and it displays all the thumbnails for the images in that gallery. Any help in figuring this out would be appreciated.
                      • 37286
                      • 160 Posts
                      I hope your galleries are small, because that may not work well within a modal window. If this is the way you wish to do it, make sure you do it by calling a resource, something like:

                      [[sekfancybox?
                        &type=`document`
                        &linktext=`Gallery 1`
                        &link=`[[~19]]`
                      ]]
                      
                      [[sekfancybox?
                        &type=`document`
                        &linktext=`Gallery 2`
                        &link=`[[~20]]`
                      ]]
                      


                      Where "link" is the page with the gallery call you wish to grab.

                      However, if you have a lot of photo's, may I suggest something more like:
                      http://rtfm.modx.com/pages/viewpage.action?pageId=42270815

                      You can see how that might look at: http://www.midwestfinestwhitetails.com/galleries/pre2011