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

    i don’t know if this should be submitted to JIRA, or not, because it is a third party problem

    -> original thread "Folders problem in default TinyMCE/mcpuk": http://modxcms.com/forums/index.php/topic,13450.0.html

    if you insert an image via TinyMCE and you want to create a link to another (bigger image) you only got the option to choose from the files folder. the above thread includes a hack which will let you choose from every folder, but i think this should be default behaviour ( without hacking ) ... does this make sense, or is there a reason to not being able to access the "images" folder?

    thanks smiley j
      • 18878
      • 210 Posts
      I agree, it should be the default functionality, because the current solution is just a workaround, but meanwhile you can try it:

      Open manager\media\browser\mcpuk\frmresourcetype.html. In order to enable the Resource Browser to display all File Types (images, files, media, etc), comment line 46 and 47:
      /* McCommented
            if ( !bHasType || aTypes[i][0] == oConnector.ResourceType ) 
                 AddSelectOption( cmbTypeObj, aTypes[i][1], aTypes[i][0] ) ; */


      And add the following lines after it:
        /*McAdded */
        /* http://modxcms.com/forums/index.php/topic,13450.msg181280.html#msg181280 */
        // IF type is the same, we have to make the option ""selected""
        if ( !bHasType || aTypes[i][0] == oConnector.ResourceType)  
        {
         AddSelectOptionSelected( cmbTypeObj, aTypes[i][1],aTypes[i][0] ) ;
        }
        else // IF not, only add this option
        {
         AddSelectOption( cmbTypeObj, aTypes[i][1],aTypes[i][0] ) ;
        }
        /* END McAdded */
      



      Then, open manager\media\browser\mcpuk\js\common.js, and to enable the Resource Browser to display all File Types, the following function has to be added at the beginning of everything:
       /* McAdded */
       /* http://modxcms.com/forums/index.php/topic,13450.msg181280.html#msg181280 */
       function AddSelectOptionSelected( selectElement, optionText, optionValue, optionSelected )
      {
       var oOption = document.createElement("OPTION") ;
       oOption.text = optionText ;
       oOption.value = optionValue ; 
        oOption.setAttribute('selected', 'selected');
       selectElement.options.add(oOption) ;
       return oOption ;
      }
      /* End McAdded */ 
      


      Hope it helps.

      Mc
        • 26931
        • 2,314 Posts
        thanks! i just saw your other post smiley
        • JIRA this?
            Rico
            Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
            MODx is great, but knowing how to use it well makes it perfect!

            www.virtudraft.com

            Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

            Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

            Maintainter/contributor of Babel

            Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
            • 20413
            • 2,877 Posts
            Did you get this to work on a basic MODx 102 install?
            It may be caching issues, but I couldn’t see any files/folders
            and had to revert back.
              @hawproductions | http://mrhaw.com/

              Infograph: MODX Advanced Install in 7 steps:
              http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

              Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
              http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
              • 26931
              • 2,314 Posts
              JIRA http://svn.modxcms.com/jira/browse/TINYMCE-48

              Did you get this to work on a basic MODx 102 install?
              It may be caching issues, but I couldn’t see any files/folders
              and had to revert back.
              didn’t succeed on a 1.0 Evo installation ... will try it on 1.0.2 too
                • 18878
                • 210 Posts
                Quote from: mrhaw at Feb 12, 2010, 06:18 PM

                Did you get this to work on a basic MODx 102 install?
                It may be caching issues, but I couldn’t see any files/folders
                and had to revert back.

                Sorry there’s a typo in the last chunk of code (a double quotation mark). The correct line should be:
                 var oOption = document.createElement("OPTION") ;


                I just tested this on a new installation of Evo 1.0 and 1.0.2 and if works fine.

                Mc

                EDIT: The original code on my previous post has also been corrected.
                  • 26931
                  • 2,314 Posts
                  Hi mcclausky,

                  I just tested this on a new installation of Evo 1.0 and 1.0.2 and if works fine.
                  yes, thanks ... it’s working