We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32038
    • 26 Posts
    wcwooldridge Reply #1, 17 years ago
    I am currently trying to reproduce a web site in MODx and have hit what hopefully is a minor snag.

    We have the following structure in the site.

    Home
    Page 1 (id=1)
    Sub Page 1-1 (id=2)
    Sub Page 1-2 (id=3)
    Page 2 (id=4)
    Sub Page 2-1 (id=5)
    Sub Page 2-2 (id=6)
    .
    .

    So the main navigation across top will have the following structure:

    Home | Page 1 | Page 2 | ...

    No problem so far. That’s working fine.

    On the Home page there is a sub nav menu that would contain a specific Parent/Child to look like this (shown in html):

    <div class="center">
      <div class="header">Page 2</div>
      <div class="subnavmain">
        <ul>
          <li><a href="link to Sub Page 2-1"><span>Sub Page 2-1</span></a></li>
          <li><a href="link to Sub Page 2-2"><span>Sub Page 2-1</span></a></li>
        </ul>
      </div>
    </div>
    


    So call to Wayfinder:

    [[Wayfinder? &startId=`4` &level=`1` &outerTpl=`tmpOuter` &rowTpl=`tmpRow`]]
    


    outerTpl - tmpOuter:

    <div class="center">
      <div class="subnav-heading">Heading goes here</div>
      <div class="subnavmain">
        [+wf.wrapper+]
      </div>
    </div>
    


    rowTpl - tmpRow:

    <li [+wf.id+][+wf.classes+]>
    <a href="[+wf.link+]"><span>[+wf.linktext+]</span></a>
    [+wf.wrapper+]
    </li>
    


    My problem seems to be I’m not sure how to access the Title for Page 2.
    I have been able to get Wayfinder to output the Sub pages as desired but the "header" text
    I have not found a way nativly to do it.

    I’ve been investigating writing some kind of snippet to get the information that I’m after,
    but before I went way down that path I wanted to make sure I am not missing something that should be obvious.

    I realize that I could move the "header" down within the <ul></ul> as an <li> item make it work.
    The reason I have not gone down this path is I’m trying not to make any changes to my existing
    css from my existing site due to issues beyond my control.

    Regards,

    Craig