We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51770
    • 6 Posts
    Hi everybody.
    Last few months I was in search for good CMS (front-end developer friendly) so I can move from Wordpress because of various reasons.
    I really like the way MODX works. Template engine, chunks, snippets, it all make sense to me.

    What I was wondering if there is any way of inserting image gallery inside rich text editor?

    When I'm making design, my usual routine is to make a "basic page template" design with predefined/predesigned elements which are usually available inside rte. Headings, lists, images, galleries, tables and quotes. And the end users can build page with them.

    I saw tutorial how Gallery extra works and building template just for gallery seams not very flexible. I want for my clients to have ability to insert gallery where they want inside page.
    Building gallery with MIGX also requires predefined place in template as I understand.
    Is there a way to do that in MODX?

    Thanks.
      • 42562
      • 1,145 Posts
      What I was wondering if there is any way of inserting image gallery inside rich text editor?
      Explain with images let us see what you are thinking.

      Whatever it is you are indeed thinking is already fascinating me, because I think it is along the same lines of what I am currently working on.

      For now, try TinyJSONGallery (TinymceWrapper Extra). It is chunk-based, very easy and powerful.
      Each chunk is a gallery.

      So in your rte, you'd place [[$myNature_Gallery]] And this is displayable in the frontend, I mean the outputted images - with fancyphoto and the like.

      BUT...
      if you mean, you want your users to edit a gallery while within an RTE resource, we need to talk.

      I have a roadmap feature that will transform [[$myNature_Gallery]] into an editable gallery. So a user can edit a gallery frontend or backend.

      PS
      And yes, anything is possible with MODX ... just provide the idea, and someone out there will bring the conclusion
      MODX is the mother of invention
      - donShakespeare
        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.
        • 4172
        • 5,888 Posts
        sounds like a job for modmore's ContentBlocks
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 51770
          • 6 Posts
          @donshakespeare
          BUT...
          if you mean, you want your users to edit a gallery while within an RTE resource, we need to talk.
          That is exactly what I mean. This would be great.
          For users to have the option/button in rte toolbar (or separate button) to insert multiple images from media browser and [[$myNature_Gallery]] chunk would be automatically inserted in rte. Chunk would be in form of some kind of button or clickable thumbnail image so user can press it and edit gallery.
          For those who would like to see chunk code they could simply press "HTML Source Editor" button in toolbar. But, general idea is that end users don't have to deal with code.

          @Bruno17
          ContentBlocks is solution but to be honest it's too much for something like that.
          donshakespeare is definitely on the right track with his extra.

          Thank you both for the answers.

            • 4172
            • 5,888 Posts
            Another way could be nested MIGX
            Each item of the MIGX-TV is a mini-gallery.
            The inner MIGX manages the images of each gallery.
            Then with &toSeperatePlaceholders, each gallery would be in a seperate placeholder and you could just place the placeholder into the textarea or tinyMCE.

            Example with single images here.
            The same principle, but not with single images, but galleries in each placeholder.

            https://rtfm.modx.com/extras/revo/migx/migx.tutorials/migx.fancybox-images-with-seperate-placeholders-in-richtext-content
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 51770
              • 6 Posts
              @Bruno17
              Thanks for the answer. It is nice idea.
              But the problem is that end users have to deal with writing placeholders. It's not anything hard but the less technical ones would find that challenging.

                • 46309
                • 79 Posts
                I have the same situation for one of my projects. The customer need to insert images and thay have to appear like a gallery on the page - popup window, ordered in a row etc. All of this have to be done inside and via the rte - just to insert the images where the cursor is between the paragraphs and that's all, no resizing, no placeholders etc. At this time the best possible and user friendly solution that I found is the one proposed by Bruno.

                It will be good if there is some other solution which is smoother for the users. There are some addons for TinyMce and CKEditor but they are commercial ones and not so cheap.
                  peace&love / bike&ride
                  • 51770
                  • 6 Posts
                  Yes, this is exactly situation on my project. I have photographer which needs to insert a lot of images in his blog posts via the rte and the images should appear as galleries. So basically he needs to insert galleries where the cursor is between paragraphs.

                  I found this plugin, not expensive, but reordering of images inside rte doesn't work nice. Besides, I'm not sure if I would now how to install it to work with MODX.
                  http://doksoft.com/soft/tinymce-image-gallery/index.html

                  Btw. Is there a tutorial for installing TinyMCE plugins like the one above with MODX? [ed. note: darkvawesurfer last edited this post 8 years, 1 month ago.]
                    • 42562
                    • 1,145 Posts
                    RE: darkvawesurfer
                    The plugin in that demo is a perfect rip off!
                    First, it does not work...
                    Second, If it did work, I can foresee at least a huge number of hells down the road.

                    Galleries in between paragraphs? This is very bad practice using raw HTML.
                    It is better to design it in such a way that you place MODX tags instead of raw HTML galleries. Don't let your client touch output gallery HTML!
                    This said, it will not be point-n-click, drag-n-drop - you'll need a certain level of coordination.

                    I use a private plugin that deals with one gallery per article (not per paragraph!) Using one TV at a time. Of course it can be extended to use multiple TVs - but I have not implemented it.
                    It can also use chunks, as I mentioned in an earlier post. With these, you can put as many galleries in between as many paragraphs as you want (using MODX tags), but you can only edit it form the Manager - you have to edit the chunks directly.

                    Btw. Is there a tutorial for installing TinyMCE plugins like the one above with MODX?
                    If the plugin is designed properly, it is a matter of adding one line to the tinymce.init configuation
                    tinymce.ini({
                      external_plugins: "/assets/imageGalleryplugin.js"
                    })
                      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.
                      • 4172
                      • 5,888 Posts
                      with MIGX you can have a setup, where you can add richtext-blocks or gallery-blocks, the same way, as you would do with contentBlocks.
                      You could also render the result into the content-field with a plugin for OnDocFormSave


                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!