We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19604 ☆ A M B ☆
    • 179 Posts
    I have several subdomains, organized in contexts. When I use a TV with a @DIRECTORY binding, I only get the files inside my MODX tree and not of the one, where the context files are stored. To make things clearer, here is my path structure:
    /cms (MODX)
      /assets
      /connectors
      /core
      /manager
      ...
    /sub1 (subdomain1)
      /assets (Assets of subdomain 1)
      config.core.php
      index.php
    /sub2 (subdomain2)
      /assets (Assets of subdomain 2)
      config.core.php
      index.php
    ...
    

    That should (hopefully) make my problem clear: Editing a resource in the context "sub2" (same name as the directory), having a template variable with "@DIRECTORY /assets", does not list "/sub2/assets/, it lists "/cms/assets". That’s bad because I cannot use "@DIRECTORY /../sub1/assets" for a binding because this would make the TV only usefull for the "sub1" context.

    In the context settings for sub1, sub2, etc. I used (without success): assets_path, assets_url, filemanager_path, filemanager_url and, of course, site_url, base_url, http_host. Anything left to set here? Must these settings also be set in the "system setting" to work in a context? Or is the context setting enough? I once had a case, where a context setting was ignored because there was no system setting set (what a "set"-crowded sentence ;-).

    I already files a bug report (http://bugs.modx.com/issues/4660) but I also want to use the forum-power in case I just missed something.

    THANKS A LOT IN ADVANCE!
    Oliver
      MINDEFFECTS – DESIGN for PRINT, WEB and MEDIA
      http://twitter.com/mindeffects · http://www.facebook.com/mindeffects · http://www.youtube.com/mindeffects/ · skype://mindeffects_oliver
      • 19604 ☆ A M B ☆
      • 179 Posts
      Is there really no one who ever did what I am trying to do?

      @MODX CORE TEAM: Do YOU know any hint for me? If it’s bug (and not me) it would be great to have that fixed in 2.1. It’s a stopper on my current project!

      Thanks
      Oliver
        MINDEFFECTS – DESIGN for PRINT, WEB and MEDIA
        http://twitter.com/mindeffects · http://www.facebook.com/mindeffects · http://www.youtube.com/mindeffects/ · skype://mindeffects_oliver
        • 21257 MODX Staff
        • 730 Posts
        This is not currently possible with the @DIRECTORY binding because it uses the site root as it’s base path.
        http://rtfm.modx.com/display/revolution20/DIRECTORY+Binding

        I’m looking into a possible solution using @EVAL and will respond here shortly with results.
          Mike Schell
          Lead Developer, MODX Cloud
          Email: [email protected]
          GitHub: https://github.com/netProphET/
          Twitter: @mkschell
          • 21257 MODX Staff
          • 730 Posts
          Hi Oliver,

          I’ve created some php code that does what you’re looking for. You can put on your server and run from an @EVAL binding.
          Usage notes are in the comments. Let me know if you have any questions.

          https://gist.github.com/974889
            Mike Schell
            Lead Developer, MODX Cloud
            Email: [email protected]
            GitHub: https://github.com/netProphET/
            Twitter: @mkschell