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

    I have a bunch of image galleries. each gallery has sub pages.
    I need to feature some of the galleries within another section of the web site.
    Initially I thought I could just use symlinks, but then realised that this only works with single pages - it doesn't symlink the child pages.
    is there any way to do this?
    I know i can use a weblink instead, but then it takes the user away form the section they are in, which I wanted to avoid.

    So I have:

    gallery
    - gallery 1
    - gallery 2
    - gallery 3
    - etc

    and I want this:

    some-new-section
    - gallery 1
    - gallery 2
    - gallery 3
    - etc

    I know I could manually symlink them all individually, but there are a lot of them, and if I add or remove on the original galleries, the symlinks won't stay in sync.

    Somehow I need to symlink and include all child and grandchild pages?!

    Is this even possible?

    Thanks
    Andy
      • 3749
      • 24,544 Posts
      You could write a utility snippet to create the symlinks, but that won't solve the problem of having to delete the symlinks when you remove an original gallery, and it would be a little tricky to get all the symlink fields correct.

      I guess a plugin attached to OnDocFormDelete or OnEmptyTrash could look for matching symlinks and remove them as well.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 51020
        • 670 Posts
        Quote from: BobRay at Nov 14, 2017, 06:41 PM
        You could write a utility snippet to create the symlinks, but that won't solve the problem of having to delete the symlinks when you remove an original gallery, and it would be a little tricky to get all the symlink fields correct.

        I guess a plugin attached to OnDocFormDelete or OnEmptyTrash could look for matching symlinks and remove them as well.

        Thanks - it's more the fact that when creating a symlink, it doesn't automatically create symlinks of all the children, but I understand why it doesn't. I was really looking for a way to create symlinks of a folder, rather than just an individual page - but I assume this isn't possible?
          • 3749
          • 24,544 Posts
          If you mean creating separate symlinks for all the children, AFAIK, it's not possible without some custom code.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting