We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11413
    • 203 Posts
    I need some direcitions on how to use the API to get page information. I want to create my menu builder, but I’m unable to get any information that really help me. The documentation describes a lot of functions, but there is no basic tutorial that say how to use them. If I understant the function :

    getPageChildren is called like this : $modx->getPageChildren(pageId,active or not, field name);

    but really, how to use it ??

    I would need some directions like : usefull functions to retrieve page information, in wich code unit I should look to find some helpfull comments etc.

    thanks in advance,

    I’m a new modx adept, and my PHP knowledge is pretty good, but i’m a little bit lost right now smiley

    Blaise
      Blaise Bernier

      www.medialdesign.com - Solutions for small business, hosting, design and more!
      • 7455
      • 2,204 Posts
      You could take a look at the snippets (dropmenu) that comes with the latest version of modx. and see how it works.

      Dimmy
        follow me on twitter: @dimmy01
      • What do you want your menubulder to do?
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 11413
          • 203 Posts
          I want to write down all the pages that are at the first level of the web-site tree. for the sub-levels, I’m gonna show them at the top of the page inside some tabs or in an other way depending of the section. This is why I want to have my own menu builder, so I can start somewhere at learning how to customize modx and i can make it fit perfectly in my template.

          thanks a lot,

          Blaise
            Blaise Bernier

            www.medialdesign.com - Solutions for small business, hosting, design and more!
          • Use the DropMenu snippet multiple times on the page. For the top level items limit it to 1 level deep. For sub-items, start the menu at the parent folder and let it go however deep you’d like.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 11413
              • 203 Posts
              Ok... but how to control the lookof the menu? I guess it’s somewhere in my style sheet?
                Blaise Bernier

                www.medialdesign.com - Solutions for small business, hosting, design and more!
              • That’s right, each menu should be in its own div or some other container, then you style that div’s menu elements. You can either define the div containers in your template, or specify a div container in the arguments you pass DropMenu and it will automatically generate the div tags with the ID or class you specify.
                  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
                  • 11413
                  • 203 Posts
                  Ok, nice... I’m beginning to understand how the menu builder works... the thing is now that I get my menu in an unordered list, but I also get the quick edit button, and I don’t want it... how can i hide that thing ??

                  Also, is it possible to have an horizontal menu with this thing?

                  thanks again,

                  Blaise
                    Blaise Bernier

                    www.medialdesign.com - Solutions for small business, hosting, design and more!
                  • You can disable the quickedit plugin from the page. You can also move it to an out of the way spot adn click the hide links link in the menu to make the "edit blah>>" link disappear.
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • Quote from: grunt_lord at Nov 10, 2005, 10:54 PM

                      Also, is it possible to have an horizontal menu with this thing?

                      Yes. It’s all in the CSS. Here’s the basics of one way to get a horizontal list:

                      #topmenu ul{
                      list-style:none;
                      }
                      
                      #topmenu li{
                      display:inline;
                      }
                      


                      Another way is to float the li elements. That can get tricky with box models and float issues between browers; there are plenty of tutorials online about how to do 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