We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26401
    • 247 Posts
    I would like to have the friendly url path customized.

    I have a ditto call in doc1, that has a child doc2 that has many children doc#
    I would like these children to display like this
    doc1/doc# and skip the doc2 is it possible to do this.

    could i inject the doc1/ into the url some sneaky way and have the U"se Friendly URL alias path" set to off?

    alternatively...
    The reason is that doc1 has a different template than doc2, in order for new documents to be created with a default template. Is it possible to designate the default template of a child document/resource when it is not the same as the parent?
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: daspoda at Mar 05, 2010, 04:09 PM

      alternatively...
      The reason is that doc1 has a different template than doc2, in order for new documents to be created with a default template. Is it possible to designate the default template of a child document/resource when it is not the same as the parent?
      I believe this can be done using ManagerManager, and if not, can definitely be done via a plugin. This would be the recommended approach.
        • 26401
        • 247 Posts
        I can’t do it using mm_inherit or mm_default


        I’ve looked through managermanager, but looks like it is unable to do this.
        mm_inherit can only inherit from a parent and mm_default does not support template

        do you have any direction I could look into for the plugin ?
          • 19369
          • 1,098 Posts
          Hi. I have three crazy ideas about it.

          1) I don’t know how differents your templates are, but maybe you could create only one template with phx and a snippet so that you can load another chunk for doc1.

          doc1 (1)
          doc2 (2)

          I create a snippet called chunk-swap:

          <?php
          $docid = $modx->documentIdentifier;
           switch($docid) {
           
            case 1: 
          return "{{ditto-call}}";
           break;
          
          default: 
          return "{{gallery}}";
           break;
           
           }
          ?>
          


          In the template I put something like this, so that I get different chunks for children of doc1:

          {{header}} 
          [[chunk-swap]]
          [*content*]
          {{footer}} 
          


          2) You could set doc1 to uncached and then use the redirect snippet found in the multilanguage tutorial (modx wiki) to another page with the choosen template.

          3) Create the doc2 in the root and address the ditto call of doc1 to it