We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37550 ☆ A M B ☆
    • 711 Posts
    Hi,

    Here goes my first ever contribution to modx, I hope everyone enjoys it.

    I’m quite sure this Plugin is finished but would like anyone to test it out and let me know of any bugs or perhaps bad pieces of code (Hopefully not smiley )

    CMSContent when installed will add a new button to FCK Editor when you click on this a dialog window will popup showing all your modx site documents simply click on the document you wish to link to and enter a link title and click ok..

    So far I have coded it to check for FURLS and if enabled it will add the FURL Prefix (if found) and Suffix, finally if you don’t have FURLS enabled it will create links like index.php?id=1.

    This plugin requires the following http://modxcms.com/MODxAPI-Library-865.html so install that first:

    Instructions are contained in the attached zip file, any problems / questions let me know.

    Have fun.

    Updated Version just uploaded Fixes the following: (0.2)

    1. Added rb_base_url to start of the link as some users don’t have modx installed off the root of thier site
    2. Removed the path setting at the top so just change your path in the include line.
    3. Removed the unused include.php while code.

      http://www.onesmarthost.co.uk
      UK MODX Hosting with love.
      • 11975
      • 2,542 Posts
      WOUAWWWW
      Great add-on and a really expected feature.

      I will test and report.

      thx for sharing

      :-)

        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 27
        • 117 Posts
        totally sweet, and this feature actually makes modx stand (even higher) above other cms’s

        well done mate!
          • 11975
          • 2,542 Posts
          I’ve installed it but got an error.


          Fatal error: Maximum execution time of 30 seconds exceeded in /myPathToSiteRoot/assets/plugins/fckeditor/editor/plugins/CMSContent/fck_cmscontent.php on line 30

          $inclfilename = '../include.php';
          
          while(!@file_exists($inclfilename)){
                      $inclfilename = "../".$inclfilename;
          }
          


          the $inclfilename = "include.php" looks like an "inheritance" from cmsSimple ;-)



            Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
            • 37550 ☆ A M B ☆
            • 711 Posts
            Whoops your totally right,

            These lines should be removed from assets/plugins/fckeditor/editor/plugins/CMSContent/fck_cmscontent.php


            $inclfilename = ’../include.php’;

            while(!@file_exists($inclfilename)){
            $inclfilename = "../".$inclfilename;
            }

            I will ammend the zip now and reupload smiley
              http://www.onesmarthost.co.uk
              UK MODX Hosting with love.
              • 11975
              • 2,542 Posts
              That’s it I’ve commented the lines and the error has disappeared.

              I keep on testing.

              :-)
                Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                • 34017
                • 898 Posts
                Aaron,

                This was a huge request. I cant wait to put this on my MODx’ed site.

                Thanks,
                Chuck
                  Chuck the Trukk
                  ProWebscape.com :: Nashville-WebDesign.com
                  - - - - - - - -
                  What are TV's? Here's some info below.
                  http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
                  http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
                  • 11975
                  • 2,542 Posts
                  Some feedback: wink

                  - Would it be possible to get title in the <a> tag, ability to set a class or id .
                  - When you have created the link using CMSContent, and saved. If you want to change the value(right clic on the link) , that is the regural link editor which appears so If you wish to change the link you have to delete it first select your text first and click the CMSContent Icon in the menuBar.


                  :-)
                    Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                    • 37550 ☆ A M B ☆
                    • 711 Posts
                    Will add them to my TODO List smiley

                    Re the <a> tag do you have an example of how it should output? And the would the css class be defined in the modx template?

                    Thanks

                    Aaron
                      http://www.onesmarthost.co.uk
                      UK MODX Hosting with love.
                      • 11975
                      • 2,542 Posts
                      Well I guess that the output should be as flexible as possible to allow compatibilty with any doctype.
                      The best would be to have the ability to set properties such as rel, id, class, target and title through input field(text).
                      The css properties will be defined as usual in css files.

                      :-)

                        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l