We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15001
    • 697 Posts
    Hi,

    According to the fourth message of this thread, posted by user fiat154, it seem possible to make mcpuk (which is called from TinyMCE) point the images in Maxigallery's "assets/galleries" folder.

    http://forums.modx.com/thread/46352/folders-problem-in-default-tinymce-mcpuk?page=3

    However, what I would like is :

    1) Make Maxigallery call mcpuk to browse images that were already loaded to the server (possibly in another gallery) and not only from the local computer.

    2) Have mcpuk point the "asset/images" folder when called from TinyMCE
    and point the "asset/galleries" folder when called from MaxiGallery.

    Is this possible?
      • 36416
      • 589 Posts
      Quote from: Jul at Jul 17, 2015, 05:16 PM
      1) Make Maxigallery call mcpuk to browse images that were already loaded to the server (possibly in another gallery) and not only from the local computer.

      Workaround: change "path to galleries" MaxiGallery setting in snippet code. Example:
      $path_to_galleries = "assets/images/";
      
        • 15001
        • 697 Posts
        @Eoler: Thanks. I tried what you tell but it didn't work. When clicking the "Browse" button to import a new picture, the folder displayed is still on my computer, not on the server.

        I assume I will have to emulate what TinyMCE does in order to call mcpuk from MaxiGallery.

          • 36416
          • 589 Posts
          Quote from: Jul at Jul 30, 2015, 02:24 PM
          @Eoler: Thanks. I tried what you tell but it didn't work. When clicking the "Browse" button to import a new picture, the folder displayed is still on my computer, not on the server.
          I assume I will have to emulate what TinyMCE does in order to call mcpuk from MaxiGallery.

          Ok, maybe I'm confused (thought you needed gallery images in imageTVs/TinyMCE).
          What would picking images from server into galleries achieve?
            • 42562
            • 1,145 Posts
            @Jul
            do not want to upload images, but reuse ones already online?
              TinymceWrapper: Complete back/frontend content solution.
              Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
              5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
              • 15001
              • 697 Posts
              @donshakespeare: Yes, exactly.

              The end user has a website where each page has a gallery associated to it.
              For instance, if the page tells about sport, the gallery contains pictures with sport topics (football, basket, tennis, a.s.o.). The page serves as background a picture which is randomly picked in its gallery.

              The end user is a non-specialist who can create and edit documents.

              I want allowing him to select for such new page, suitable backgrounds which were already loaded to the server. For instance, if the new document is telling about the local football club, the end user should be able to import in the gallery associated to the document one more of existing pictures showing football things.

              The idea is that the end user doesn't need the backgrounds being stored on its computer or an usb key, so that new pictures uploaded by the graphic designer are right away available to the end user.

              The best would be that MaxiGallery uploads all background pictures in the same folder (and not in one subfolder per page), so that the pictures are easier to pick, and that an already loaded picture remains stored in the cache of the browser.
              Doing so will a priori be easy by editing MaxiGallery's source code, as the association between images and documents is not stored by the folder structure, but in database.

              The remaining question is calling FCKEditor/mcpuk from MaxiGallery, and let it manage the assets/galleries folder.

              FCKEditor/mcpuk should just return the path to the picked image in the managed MaxiGallery's "upload image" field.

              If all pictures are stored in the same folder, MaxiGallery's "Upload pictures" should of course not re-upload the picture, but only update its database to store the new "image-M-available-to-page-N" relationship.

              The possibility to upload new pictures from the local computer would also be nice, so that the graphic designer can upload new pictures easily.
              So, there should ideally be two buttons for each "import image" field "Pick from picture library" and "Import from my computer".
              If it too complicated to have those two buttons, the website designer would upload the pictures using FTP.
                • 42562
                • 1,145 Posts
                You want a file manager that has a customizable callback function, field_id and start_folder parameters. And this file manager is either standalone or hooked to your RTE - with possible upload.

                The callback function is to tell the file manager what do when an item (e.g an image) is clicked.
                It will grab the url of the item clicked, and possibly close the window when done other things you want.

                The field_id parameter is attached to the url you used to open the file manager - it is dynamic, can be the id of your input field of choice (#upload_image)
                This tells the file manager where to paste the url it grabbed from the clicked image

                The start_folder parameter is attached to the url you used to open the file manager - it is dynamic; the file manager will use the value there as its starting point

                assets/components/filemanager/browser.php?field_id=upload_image&start_folder=assets/baseball/swords

                assets/components/filemanager/browser.php?field_id=upload_image2&start_folder=assets/football/makeup

                If this is precisely what you are looking for, find out if FCKEditor/mcpuk can handle it.
                The callback function and field_id are standard business for major file managers
                  TinymceWrapper: Complete back/frontend content solution.
                  Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                  5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                  • 36416
                  • 589 Posts
                  Quote from: Jul at Jul 31, 2015, 08:31 AM
                  The best would be that MaxiGallery uploads all background pictures in the same folder (and not in one subfolder per page), so that the pictures are easier to pick, and that an already loaded picture remains stored in the cache of the browser.

                  I would not use MaxiGallery with this (a bit convoluted) requirements, just organize themed images into folders (you can upload multiple pictures in KCFinder).
                  If you need to enable picking multiple images for single resource, put them in a MultiTV:
                  https://github.com/Jako/multiTV/blob/master/assets/tvs/multitv/configs/images.config.inc.php