We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26027
    • 145 Posts
    I duplicated a resource called 'home' (home.html) and called the new one 'duplicate of home' (duplicate-of-home.html).

    There's a menu item called home which, through some accident of MODx, picked up the name 'duplicate-of-home.html'. The resource ID should be 1 and instead it's the duplicate's ID of 448.

    I believe from the documentation the developer used the Ajax Menu system. Can someone bring their intuition to my assistance and suggest where I might find the wrong resource coded so that I can fix it.

    If you need any additional info supplied I'd be happy to accommodate.

    I've checked quite a few templates, chunks and snippets and so far have not found coding for either ID 448 or 'duplicate-of-home.html'. I'm really stuck and the developer walked away from the project and can't help me. I'm OK with MODx Evolution but not especially talented.

    Thanks very much to any good samaritans out there ... Sam
      • 10208 ☆ A M B ☆
      • 1,780 Posts
      So the menu is not generated with Wayfinder? Most of figuring this out for you depends largely upon how the menu is generated and where the resources are in your resource tree (resource hierarchy).

      This resource "home" with the alias of "duplicate of Home" is ID 448, yet where in the menu does it appear? Is it a top level menu item? Is it appearing where the home resource should appear? Only instead of linking to the real home page/resource, it's going to this duplicate?

      One way to find the missing resource is to open all the container resources up in the resource tree, and run a ctrl+f and search for 448.

      Is this an Evolution or Revolution site? Which version?

      I'm thinking "duplicate of home" is the resource alias, which is set automatically if you've got the system setting to do so, set to yes. If the menu link is taking you to the id 448 (duplicate), where did the original Home go? Can you find ID 1?


        Frogabog- MODX Websites in Portland Oregon
        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
        Having server issues? These guys have MODX Hosting perfected - SkyToaster
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        If you can copy/paste the code from your template for the menu, we'll be better able to figure out what it going on.
          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
          • 26027
          • 145 Posts
          Quote from: frogabog at Apr 02, 2013, 12:08 AM
          So the menu is not generated with Wayfinder? Most of figuring this out for you depends largely upon how the menu is generated and where the resources are in your resource tree (resource hierarchy).

          This resource "home" with the alias of "duplicate of Home" is ID 448, yet where in the menu does it appear? Is it a top level menu item? Is it appearing where the home resource should appear? Only instead of linking to the real home page/resource, it's going to this duplicate?

          One way to find the missing resource is to open all the container resources up in the resource tree, and run a ctrl+f and search for 448.

          Is this an Evolution or Revolution site? Which version?

          I'm thinking "duplicate of home" is the resource alias, which is set automatically if you've got the system setting to do so, set to yes. If the menu link is taking you to the id 448 (duplicate), where did the original Home go? Can you find ID 1?


          Frogabog, I'm sorry if I appear dense. I'm confused a bit because the developer has many components that all come together. Unfortunately no one template tellsthe whole story.

          Regarding "Wayfinder", that IS installed on the system as a snippet. I thought it was an AjaxMenu because of an ID statement preceding the nav elements called 'MyAjaxNewsMenu'. Here's a text capture of all the generated HTML for this particular menu, as seen by Firebug:
          <div id="navigation">
          <div id="newsnav">
          <ul id="myAjaxNewsMenu">
          <li id="tm448" class="mnnews first ">
          <a class="mnnewsmenu" title="Duplicate of Home" href="/duplicate-of-home.html">Home</a>
          </li>
          <li id="tm8" class="mnnews">
          <a class="mnnewsmenu" title="News" href="javascript:;">News</a>
          <ul class="newssubnav" style="display: block; height: 0px; overflow: hidden;">
          <li id="tm24" class="subli first">
          <a title="News Featured Headline" href="/news/news-featured-headline.html">Headlines</a>
          </li>
          <li id="tm23" class="subli last">
          <a title="Archives" href="/news/archives.html">Archives</a>
          </li>
          </ul>
          </li>
          <li id="tm9" class="mnnews ">
          <a class="mnnewsmenu" title="Publications" href="/publications.html">Publications</a>
          </li>
          <li id="tm10" class="mnnews last ">
          <a class="mnnewsmenu" title="Resources" href="/resources.html">Resources</a>
          </li>
          </ul>
          </div>


          You may or may not recognize it as Wayfinder code.

          Regarding the version we're using, it's Evolution 1.04, Rev. 6981.

          You can see this problem currently at the following URL: http://staging.edlawcenter.org/home.html
          The "Home" link at the top, toward the right, is the one that links to the duplicate of the home page. The two resources are both visible and neither is "lost". ID 1 is a top level resource and is the real Home page. ID 448 is the duplicate of Home and has been assigned a URL alias of '/duplicate-of-home.html'

          Regarding your statement:
          I'm thinking "duplicate of home" is the resource alias, which is set automatically if you've got the system setting to do so, set to yes. If the menu link is taking you to the id 448 (duplicate), where did the original Home go? Can you find ID 1?
          I'm not sure what you mean by it being a resource alias and it being set automatically. It appears to be a full duplicate of the original home page and I can't imagine why MODx would think it should substitute it as the proper link for the original link 'home.html'

          I hope I've answered your questions so far, I just wish I could get lucky and find some snippet, template, chunk, or whatever that has the 448 resource clearly referred to.

          Thanks for reading ... Sam
            • 26027
            • 145 Posts
            Reply to Susan:
            I'm going to paste the template here. It's for the home page only and makes many references to other elements, so I don't think it's going to tell you too much by itself. I'll be happy to supply more information.

            {{tpl_header}}
            <div id="homecontainer">
            <div id="topcontainer">
            <div id="rightcontent">
            <a name="jonbegin"></a>
            <div id="homejoinournetwork"> [[Ditto? &documents=`22` &tpl=`home_join`]]</div>
            <div id="donate"> [[Ditto? &documents=`21` &tpl=`home_donate`]]</div>
            </div>
            <div id="content" [[mkBgImage? &bgImage=`[*BackgroundImage*]` &bgParams=`no-repeat scroll 0 0`]]>
            <div id="contentbottom">[*#content*]</div>
            </div>
            <div class="clearboth"></div>
            </div>
            <div id="homeitems">
            [[Ditto? &parents=`1` &filter=`id,21,2|id,22,2` &tpl=`home_headline_item` &sortBy=`menuindex` &sortDir=`ASC`]]
            </div>
            <div id="newsitems">
            <div id="homeotherheadlines" class="sectiontitle">News Headlines</div>
            [[Ditto? &parents=`23` &start=`1` &tpl=`home_news_item` &tplLast=`home_news_item` &sortBy=`pub_date` &sortDir=`DESC` &depth=`3` &total=`5` &hideFolders=`1` ]]
            </div>
            </div>
            {{tpl_footer}}
              • 10208 ☆ A M B ☆
              • 1,780 Posts
              Quote from: samg at Apr 02, 2013, 12:14 PM


              {{tpl_header}}

              Sam,

              Can you paste what's in the above referenced chunk? That chunk, tpl_header is what contains the wonky menu items.

              Did you happen to expand the resource tree and do a find for "448"? Locating that resource will help you solve this.
                Frogabog- MODX Websites in Portland Oregon
                "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                Having server issues? These guys have MODX Hosting perfected - SkyToaster
                • 26027
                • 145 Posts
                Quote from: frogabog at Apr 02, 2013, 03:48 PM
                Quote from: samg at Apr 02, 2013, 12:14 PM


                {{tpl_header}}

                Sam,

                Can you paste what's in the above referenced chunk? That chunk, tpl_header is what contains the wonky menu items.

                Did you happen to expand the resource tree and do a find for "448"? Locating that resource will help you solve this.
                Hi Frogabob. I looked for 448 in the resource tree but I'm not sure what you were hoping I'd find. The 'find' only looks at the titles and it found the 'duplicate of home' item only. I've tried to attach a graphic of the compressed resource tree. It may well come in handy when you look at the tpl_header file which has the Wayfinder syntax. That syntax makes reference to many of the first level Resource IDs in the tree. It may or may not be significant that the duplicate home page is a first level item, making it easier for a syntax error to include it in the menu.

                I never attached anything to a forum post here but it's not rocket science so I attached the tpl_header as well.

                Thank you very much for your interest in helping me. Naturally I hope you're successful.

                Best ... Sam
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  The problem is in the "newsnav" Wayfinder call. If you want the home page in that menu, you need to remove the 1 from the list of &excludeDocs. You don't need the duplicate resource at all.
                  <div id="newsnav">
                   [[Wayfinder?startId=`0` &excludeDocs=`2,3,4,5,6,7` &level=`2` &outerTpl=`mnews.OuterTpl`  &innerTpl=`mnews.InnerTpl` &rowTpl=`mnews.RowTpl` &innerRowTpl=`mh.InnerRowTpl` &parentRowTpl=`mnews.ParentRowTpl` &firstClass=`first` &hereClass=`current` &selfClass=`here` &rowIdPrefix=`tm`  &sortBy=`menuindex` &sortOrder=`asc` ]]
                  		</div>
                    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
                    • 26027
                    • 145 Posts
                    Quote from: sottwell at Apr 02, 2013, 06:38 PM
                    The problem is in the "newsnav" Wayfinder call. If you want the home page in that menu, you need to remove the 1 from the list of &excludeDocs. You don't need the duplicate resource at all.
                    <div id="newsnav">
                     [[Wayfinder?startId=`0` &excludeDocs=`2,3,4,5,6,7` &level=`2` &outerTpl=`mnews.OuterTpl`  &innerTpl=`mnews.InnerTpl` &rowTpl=`mnews.RowTpl` &innerRowTpl=`mh.InnerRowTpl` &parentRowTpl=`mnews.ParentRowTpl` &firstClass=`first` &hereClass=`current` &selfClass=`here` &rowIdPrefix=`tm`  &sortBy=`menuindex` &sortOrder=`asc` ]]
                    		</div>
                    Susan, before I do this (and I trust you and will) I wanted to ask if you know why this suddenly went sour. The '1' was always there so if it was always excluded I wonder what that where that 'Home' link was pointing to before I duplicated the original 'Home' page.

                    Do you have a hunch, even if you don't know for sure?

                    Thanks much ... Sam
                      • 10208 ☆ A M B ☆
                      • 1,780 Posts
                      It looks like that particular menu should not contain the home page at all, as it's in the other menu, and clearly excluded in the Wayfinder call. However, after creating a top level duplicate, it got included by default. :~}

                      As Susan says, "If you want the home page in that menu..." (do what Susan said, remove id 1 from the &excludeDocs parameter).

                      But if not, if it's not supposed to be there at all, simply delete the resource id 448 (duplicate of home) and it won't show up any more. Problem solved. smiley
                        Frogabog- MODX Websites in Portland Oregon
                        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                        Having server issues? These guys have MODX Hosting perfected - SkyToaster