We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    Symlinks are cool. On my symlink I can specify a template, a title, a description, and TVs, and then the target of my symlink will be loaded up with its content. However, sometimes I don’t want to use my own title/description/etc... is there any way to tell a symlink to defer to the target on those other attributes? Does that question make sense?

    Thanks for any ideas!
      • 5340
      • 1,624 Posts
      What about a Weblink?
        • 9207 ☆ A M B ☆
        • 2,475 Posts
        A weblink won’t work for a few reasons... hard to summarize, but we’re using a lot of complex permissions and the templates are customized in such a way that if you jump over to a different directory via a weblink, the menus won’t render correctly, whereas the symlink behaves as if it’s in the directory where it’s placed. I could figure out a way around that, but in this situation, SymLinks are cleaner.

        More importantly, though, is that it’s REALLY nice to be able to use a SymLink and to override SOME attributes, and that’s not possible with WebLinks. E.g. I can have multiple SymLinks pointing to the same page, each SymLink containing a different TV value, for example. That’s really useful. But it’d be nice if I didn’t have to provide values for the title/description/etc. if I don’t need to.

        It’d be a nice feature if you could selectively override elements as needed. I probably could write a plugin that could check for empty values and get what I want that way...
          • 19534
          • 183 Posts
          You may do this by using the If and getResourceField snippets:

          • check whether the class_key of the current displayed resource is modSymlink or modDocument using If
          • when modSymlink: [[getResourceField? &id=`[[*content]]` &field=`myField`]]
          • when modDocument: [[*myField]]

          But of course a built-in functionalty in the MODx core would be much better.

          Cheers,
          Jakob
            Add-On to easily manage your multilingual sites: Babel