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

    i have 3 websites in one MODX instance that all the same company content (about us and so on).
    Now it would be great if i have to edit the company content only once. How do i do that?

    Requirements:

    • edit the company content only once
    • see same company content in all n websites.
    • the shared company resources have to behave like they are part of the particular site

    Examples:
    example1.com/company/about_us.html
    example2.com/company/about_us.html
    example3.com/company/about_us.html

    Resource Tree in backend:
    web
       - example1.com
          - ...
          - company
             - about_us
             - ...
    
       - example2.com
          - ...
          - company (same as in example1.com)
             - about_us
             - ...
    
        - example2.com
          - company (same as in example1.com)
             - about_us
             - ...
    en
       - ...       
      


    I tried to solve this with a symlink on the company resource, but:

    • only the linked resource is available not it's children. So symlinking in modx is somewhat different from what you can do in a file system.
    • and it seams that simple search cannot find content from the symlinked resource. i can only find the site name 'company' of the symlink resource, but not the actual content. Hint: I restricted simple search to specific sites. so if you search on website example2.com you only find resources below example2.com point in the resource tree.But as

    So is there a way to say symlink this parent resource and all it's children?
    and does or does not simple search can read symlinked content?

    So please give me some directions how to solve this in the modx way.
      • 42562
      • 1,145 Posts
      I think symlink is the way to go, but as you realized there are 'drawbacks'.
      I am sure symlink is per resource - not more than one (even children) at a time...I hope I am wrong.

      Simplesearch will search only real [[*content]] in a resource, so other weird things like symlink and getResources contents will not be included; again I hope I am wrong.

      If I find a solution I will tell you.
        TinymceWrapper: Complete back/frontend content solution.
        Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
        5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        All symlinks do is pull the content of the resource linked to. It has no content of its own, its content is the ID of the resource being linked to. So unless the search snippet has a "follow symlinks" property, no, it won't search the target resource's content.
          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