We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31178
    • 128 Posts
    Here is a small widget for ManagerManager: mm_widget_weblink

    It adds an insert button to the weblink field to allow selection of a file instead of having to type in the full path. Useful for those users who are not familiar with file paths to the assets folder. The bulk of the code is from the template variable ’file input type’.

    Usage:
    mm_widget_weblink($roles, $templates)

    $roles: comma separated list of role IDs this should be applied to. Leave empty (or omit) for all roles [Optional - default is all]
    $templates: comma separated list of template IDs this should be applied to. Leave empty (or omit) for all templates [Optional - default is all]

    Installation:
    Copy the weblink folder to the \assets\plugins\managermanager\widgets subfolder.

    weblink.zip version is for MODx 0.9.x
    weblink-evo.zip version has been updated to work with MODx Evo 1.x
      • 16892
      • 107 Posts
      Could a parameter be added that restricts the user to a particular folder in the Files directory? Or is this handled via the manager users permissions?

      I want to create subfolders in Files by subject matter and restrict roles/templates to link only to files.
        • 31178
        • 128 Posts
        Nice idea, but I don’t know of a way to force the Resource Browser to open at a certain folder... unless anyone knows how?
        • I believe that you can specify the path in the individual user’s profile in the User tab.
            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
            • 31178
            • 128 Posts
            Yes, I suppose that is a good compromise, it does not allow you to set a path for a template which I think would be the most useful.
              • 16892
              • 107 Posts
              This widget doesn’t seem to be working under Evo 1.0.2.

              Here is my code:

              mm_widget_weblink('', '');


              The button does not appear and the following error appears:

              ManagerManager: An error has occurred: TypeError - $("head") is null
                • 31178
                • 128 Posts
                Thanks for letting me know legatissima. I have now posted an Evo version. See first post.
                  • 16892
                  • 107 Posts
                  You’re welcome!