We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42451
    • 17 Posts
    following problem:
    a lot of my clients have a limited resource tree (e.g. only access to the blog) but should be able to link to all resources

    drag and drop from the resource tree is no option because of the limited file tree
    another option would be to insert internal links with the id (e.g. [[~123]]) but it's cruel to assume that any customer knows the ids

    is there any possibility to insert links to internal resources anyway?
      • 36695
      • 47 Posts
      I've been facing this issue too. As a workaround I've been hacking at the existing Link dialog. Currently I've got something that shows the site pages in a drop down within the link dialog, having added an extra link type.

      https://github.com/prioritypie/modxlink

      You can edit the modxlink.php file in the dialogs folder if you want to do any custom filtering of the list of pages displayed.

      Please note that this is very early development, so beware! It's based on a copy of the original link plugin, and there's loads of stuff that needs updating to separate it entirely.
        • 42451
        • 17 Posts
        thanks for your quick reply

        i'll check it out

        i'm also considering customizing the link plugin to work with modx as seen in this post:
        http://ckeditor.com/forums/CKEditor-3.x/Tutorial-how-modify-Links-Plugin-link-cms-pages
        with a nice but simple dialog, this should be a great option

        what also would be nice is a new type of media source
        you have the standard-options "filesystem" or the "amazon cloud", i guess a "ressource" type would be great because it would work with every editor and the "browse server" button and you can use the existing modx ressource browser, the same you use for searching images e.g.
        • Ryan's branch of 2.3 is worth looking into as far as resource/element search goes. Pretty nice. https://github.com/rthrash/revolution

          You have to download the zip, edit the _build config files and build it with the transport.core.php file before you can install, but it's worth looking at.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 42451
            • 17 Posts
            @prioritypie

            before i uploaded your version, i checked your code (modxlink.php) a little bit and i found 3 lines of code in the first minute that you should fix:

            line 10, always put your defines in quotation marks:
            define(MODX_API_MODE,TRUE);

            to
            define('MODX_API_MODE',TRUE);


            line 91, wheh you output something to javascript, please always strip quotation marks, if you use them to build arrays
            modx supports quotation marks in the pagetitle, so please strip them out or you get an javascript error for sure:
            'text' => str_repeat($this->indentor, $index) . $item['pagetitle'],

            to
            'text' => str_repeat($this->indentor, $index) . str_replace('"','',$item['pagetitle']),


            line 263, $this surely can not work outside of the class:
            $selectItems = $this->FormatArray($pagesList);

            to
            $selectItems = $Viewer->FormatArray($pagesList);


            i fixed this 3 things in my copy and it works like a charm
            good job

            when i have the free time, i'm looking forward to clone your little project and combine this with an ajax search or the modx cache, to load the resources faster
            but anyways, its the best solution at the moment, thank you

            best regards
            fk_abs [ed. note: fk_abs last edited this post 10 years, 8 months ago.]
              • 36695
              • 47 Posts
              Thanks @fk_abs
              I confess that I made some changes to the code outside of my working copy just before prepping it and uploading to github, so a couple of your fixes are as a result of me typing blind untested code! (poor excuse I know...)
              I've got a couple of clients that I really want to use this with at the moment, so I'm hoping to get a chance over the next few days to look at the search and cache issues. I'll update the repo and post again here if I sort it. The fab Redactor editor from modmore does a good job of the search (it's just a shame there are a couple of features missing at the moment, like applying custom classes/styles).

              @sottwell
              Yes, that branch is looking good. Can't risk it on production sites at the moment of course, but I'm really looking forward to the next few months. I think we're heading for a eureka moment when all the backend power and flexibility that has always been a part of MODX comes hand in hand with a streamlined and friendly manager ui.
              • No, it doesn't work yet, but some of the new features that do work are quiet interesting.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 42046
                  • 436 Posts
                  Quote from: [email protected] at Aug 05, 2013, 07:33 PM
                  The fab Redactor editor from modmore does a good job of the search (it's just a shame there are a couple of features missing at the moment, like applying custom classes/styles).

                  If you enable the pre-release channel in your Modmore account, the latest version of Redactor includes custom style classes along with 'clips' which can be used to insert defined chunks of code.

                  https://www.modmore.com/extras/redactor/documentation/creating-custom-formats/
                  • Um... how do you "enable the pre-release channel" in a Modmore account?

                    Never mind, I found it, in the API keys page.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 40088
                      • 708 Posts
                      I apologize if this isn't the correct place to post this question.

                      I'm trying to add a custom class to the Styles drop-down menu in the CKEditor toolbar. I've been able to successfully add a span style but that's not what I need, I just want to add a class to block-level elements like
                      li class="button"
                      for example.

                      So, can anyone shed some light on what the proper syntax should be?

                      Thanks
                        Todd