We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36182
    • 6 Posts
    My question is pretty simple, and I really hope there's a good answer for it. smiley How do you manage content images (the images used inside resources) in Revo? Is there an easy way to attach several images to a page (so that there would be a connection between resource and it's images in the database)?

    Let me clarify.
    Let's say you have a website with articles added by a content manager on a regular basis. Every article can contain several images — illustrations, photos, etc.

    Content manager can handle TinyMCE, but he's by no means a pro user. He's just the owner of the site.

    As far as I understand, every time he creates a new article, he needs to:

    • go to file manager;
    • invent a new name for a folder which will contain images for this article;
    • create that folder;
    • upload his images;
    • get back to the article and insert those images.

    This should work fine for 5-10 pages. 20, even. But for 100 articles, it would be a mess. A hundred of manually created folders? And what if someone needs to add an image to specific article? Or to delete one of them? He will need to locate the necessary folder among hundreds, wouldn't he? And how soon content manager will start making mistakes, putting images in wrong folders, deleting something by accident... you get the picture.

    Now, in Drupal one can attach images directly to a page, manage them in page editing mode. When the page is deleted, images go down with it. This makes content editing immensely more natural.

    Is there a way to achieve something of a kind in MODx? Some extension, perhaps? Or some other way to manage images with resource, not separately?
      • 3749
      • 24,544 Posts
      Check out Template Variables (with the type set to 'image').

      When you edit a page in the manager, you go to the 'Template Variables' tab. You can upload an image file for the TV through TinyMCE. Then the image is associated with the page and you just need a TV tag on the page to display the image:

      [[*TvName]]
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 36182
        • 6 Posts
        Thank you for your answer, Bob.

        — Unfortunately, I couldn't find a way to upload image file for the TV through TinyMCE. When I press the button next to Address, it just opens the standard File Manager window, that's all.

        — What if the number of images my content editor needs is unspecified? As far as I understand, image TV is just one image. I need to add several — I don't know how much in advance. Should I add, say, 50 image TVs to an article template «just in case»?

        — If I have a 100 articles with 5 images in each — it would make 500 images. Can't keep that many in one folder, so my content editor will have to do all that stuff I described above: create image folder for each article manually, upload images to that folder, et cetera.

        What I need, I guess, is a way to create a gallery for each article. Gallery, which will be attached to the article, which will be deleted when the article is deleted. And some easy way to select images from that gallery and insert them into TinyMCE. Is there a way to get something like this in MODx?
          • 3749
          • 24,544 Posts
          You're right, my solution is only good if you have a small number of images and you know how many will go on each page. I haven't really used the Gallery add-on component, but I think it will be your best bet.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 4172
            • 5,888 Posts
            Its also possible to use MIGX and add placeholders to the content for content-images as described in this tutorial:
            http://rtfm.modx.com/display/ADDON/MIGX.Fancybox-images+with+seperate+placeholders+in+Richtext-Content

            you have still to create folders for each resource, but with some coding it should be possible to extend MIGX with functionality to let it create seperate image-folders automatically for each resource.
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 36182
              • 6 Posts
              Bruno, thank you, from the description of MIGX it seems it is worth a try.

              I guess I can even auto-create image folders with the right plugin... wonder if I'll be able to set file managers root directory to that auto-created folder when someone is editig the resource — so that he won't have to select it manually.

              I'll check it out and report if I was able to achiveve the desired behavior. smiley
                • 4172
                • 5,888 Posts
                I did some work for autocreating resourcefolders and commited to github, what I have so far.
                Its not finished, but basically working (creating folders in a given base-directory and setting file-managers base_path for in MIGX included image-TVs to this folder). [ed. note: Bruno17 last edited this post 12 years, 5 months ago.]
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 36182
                  • 6 Posts
                  Can you give a link? I'd check it out, maybe give some useful feedback. smiley
                    • 4172
                    • 5,888 Posts
                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!