We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21872
    • 95 Posts
    This might be a stupid question, but I can’t seem to manage it. If I create a container with an alias of ’miscs,’ what is the correct way to get alias child resources so that http://mysite.com/miscs/resource.html gets to the resource and a getPage call like this:
    [[!getPage? &element=`getResources` &parents=`35`  &depth=`1`  &limit=`10`  &pageVarKey=`page`  &includeTVs=`1`  &includeContent=`1`  &tpl=`blogListPost`]]
    <div class="paging">
    <ul class="pageList">
      [[!+page.nav]]
    </ul>
    </div>
    (almost identical to the wiki entry) will also generate http://mysite.com/miscs/resource.html as the link? if I use /miscs/resource as the alias, the address is fine but getPage generates http://mysite.com/miscs/miscs/resource.html

    What is the right way to create virtual paths from containers?

    Thank you.
      • 28215
      • 4,149 Posts
      Add

      <base href="[[!++site_url]]"></base>
      


      to the HEAD of your template.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 21872
        • 95 Posts
        OK, that makes sense, thank you.

        More generally, is there a way to tell it to treat containers as part of the path without specifying them in the alias?
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: nsfdev at May 02, 2010, 09:58 AM

          More generally, is there a way to tell it to treat containers as part of the path without specifying them in the alias?
          Treat containers as part of what path without specifying them in the alias? The alias of the parent container is the path if using the friendly_alias_path option.