We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15826
    • 160 Posts
    I managed to get a custom template installed, though it’s not quite finished, and managed to get the first snippet installed (SimpleListMenu saved in the snippets as TopListMenu since it’s the Header Nav) and the snippet seems to be functioning the way I want, since it’s inserted the links to the three toplevel documents I have created. Problem is the links don’t work.

    http://languagelearner.com

    In system config I have use friendly urls set to yes, with no prefix, a suffix of .htm and use aliases set to yes. Alias paths are also set to yes, allow dupes-yes, and autogenerate alias-no.

    I have three docs toplevel. Lessons, with an alias of "lessons", Home with an alias of "home" and Language Learner with an alias of "languagelearner".

    The urls show up exactly the way I’d expect them to, but when you click any of them they 404. What did I miss?

    This is the first time I’m doing config on this CMS, though I’ve templated it before, and I’m finding it pretty different from the other scripts I’ve worked with. Any steers would be helpful. BTW, those three docs are the ONLY three docs I have in toplevel. I did make a folder on Lessons, and managed to get a subdoc in it. The next step is adding a second menu on the left which will pick up the links to the pages in whatever section the visitor is visiting, so any ideas on ways to approach that would be good. The guy wants to grow the site to around 900 documents, so setting this up to make sense from the beginning is pretty crucial.

    Thanks in advance for your help. And yes, Ryan, I didn’t forget the promise I made to you to help with documentation. After trying to find the answers without asking this question I’m very aware of how critical this step is for the growth of the community.
      "I’d love to change the world but I can’t find the source code . . ."

      Custom ModX Templates
      • 26435
      • 1,193 Posts
      Did you rename "ht.access" in the root of your MODx installation to ".htaccess"?

      -sD-
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages
        • 15826
        • 160 Posts
        Yup, that’s what I was missing . . . thanks! Now on to the next thing on my long list of things . . .
          "I’d love to change the world but I can’t find the source code . . ."

          Custom ModX Templates
        • Don’t forget to rename the one in your /manager folder as well...it turns off the rewrite for it and its children, since you don’t want them to be rewritten!
            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
            • 15826
            • 160 Posts
            Thanks again!

            Now, on to figure out whether to use a snippet, a tv, a chunk or a combination . . .
              "I’d love to change the world but I can’t find the source code . . ."

              Custom ModX Templates
            • I always (well, almost always) contain my snippet calls in chunks. The chunk will contain the immediate <div> container for the snippet’s output:

              <div class="sidebar" id="sideMenu">
              <h3>Welcome, [!Personalize!]</h3>
              [!DropMenu!]
              </div>
              


              This keeps my main template very clean and simple, with just the HTML I need for the basic layout.

              Then I can either directly call the chunks where I want them in my template (such as {{Footer}} in the "footer" container, or, even better, use TVs to specify which chunks I want in that spot on which pages. For example, on the home page I want the main menu chunk, then the login chunk, then the search chunk. On other pages, I want the main menu chunk and the search chunk. Or maybe I only want the login chunk to show on my Blog page, and not the home or any other pages. Or I decide I’d rather have the search chunk first in the sidebar.

              I can create the TVs, have their input be textareas, and use @HUNK in each one, thus giving the flexibility of putting which chunk I want on which pages, in which order! I put the TVs in my template, and they show up for editing with each document.

              So basically, I keep my template as simple as possible, use chunks to contain discrete blocks of content, TVs to organize them and do other neat stuff that TVs do, snippets to add localized functionality, and plugins to add global functionality and extra pre-processing.
                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
                • 15826
                • 160 Posts
                Oh, that makes a lotta sense. Talk about a lightbulb moment! I now know how to structure this so each section can have its own nav. One more question though. The way I currently have this I’m calling that SimpleListMenu snippet directly from the template. Am I correct in assuming that no matter what folder it’s in it’ll call the links that are in the root folder? Or do I need to restructure that in some way?

                Oh, and please keep in mind when you answer my questions that I’m a front-end xhtml/css gal, and know just enough about php to get me in HUGE trouble . . . but I am capable of following good instructions smiley
                  "I’d love to change the world but I can’t find the source code . . ."

                  Custom ModX Templates
                • Depends on how it’s coded. Most of the menu snippets will by default use the current page as the "root", thus only showing the docs under the current doc (if any). Almost all of them require an argument to specify which "folder" you want to use as the root, such as [!SimpleListMenu?id=`0`!] to use the site root. Usually the snippet code will have comments at the beginning to tell you how to use it.
                    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