We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23478
    • 133 Posts
    Hello

    I’ve just intalled MODxAPI ....
    I’ve run the exemple (calling DropMenu) but it dosen’t work :S

    I’m running MODx 0.9.5 RC2 with
    MODxAPI is said to be 0.1 (D/L from repository)(*)

    When I run my test, the menu appears... but each every link leads to a [~XX~]
    as if outputContent didn’t produce anything undecided
    If I’m not clear enought, an exemple can be found at : http://www.parapentiste.info/testmonmenu.php
    (may be broken from time to time as I still search)

    I’ve tryed to call $modx->outputContent
    I’ve tryed to put $modx->documentMethod = "alias"; (as it is empty)
    but nothing changes


    (*)There are two archives in repository and a third one (extras) is empty
    3 results found for "MODxAPI".
    MODxAPI Library | 0.1
    MODxAPI Library
    MODxAPI Library | Extras
      • 32963
      • 1,732 Posts
      Hi,

      Thanks for the feedback. Sorry about the delay in reponding to your question.

      Well you are absolutely correct the runSnippet does not parses the [~tags~] ar all. I think I’ll add a parse() function to the API to make it easier to do just that.

      For now here’s a quick fix if you have not solved the problem as yet:
      $html = $modx->rewriteUrls($html);


      The rewriteUrls() function should convert all your [~~] to valid url links.

      Let me know if this one works for you.
        xWisdom
        www.xwisdomhtml.com
        The fear of the Lord is the beginning of wisdom:
        MODx Co-Founder - Create and do more with less.
        • 23478
        • 133 Posts
        Hello

        Quote from: xwisdom at Nov 17, 2006, 10:29 AM

        Let me know if this one works for you.

        grin Yesssssss it works fine !

        maybe another suggestion : In the sample (which is only including the menu) you may remove the
        $html = $modx->getChunk('Menu-StyleSheet');

        just add a word saying that calling a chunk is as simple as this code ...

        because, with my poor english, I did search a little (and im’ still not conviced I’m 100% right removing that call)

        BTW : it’s a very nice feature !
        It’s much better than calling iframes laugh (was my last option)
          • 32963
          • 1,732 Posts
          Quote from: piwaille at Nov 17, 2006, 11:14 AM

          maybe another suggestion : In the sample (which is only including the menu) you may remove the
          $html = $modx->getChunk('Menu-StyleSheet');

          just add a word saying that calling a chunk is as simple as this code ...

          because, with my poor english, I did search a little (and im’ still not conviced I’m 100% right removing that call)

          BTW : it’s a very nice feature !
          It’s much better than calling iframes laugh (was my last option)

          Many thanks piwaille. Glad you got it working. I’ve updated the example so I hope it will make things much clearer for other users.
            xWisdom
            www.xwisdomhtml.com
            The fear of the Lord is the beginning of wisdom:
            MODx Co-Founder - Create and do more with less.
            • 15426
            • 12 Posts
            I am encountering an error with my site, and I think it can be traced to MODxAPI.

            The app works great on my first log in, but if you log out and log in again, it fails to return anything from this query.... it’s really strange.

            $userid = $modx->getLoginUserID();

            I still get $userid when I call it from a page directly in MODx, but as soon as I reference an independant file, nothing. Again, only on the second login of a browser session.

            I am completely stumped and would love any help on the matter!

            Thanks!
            Greg
              • 32963
              • 1,732 Posts
              Hi kasper48,

              Don’t know it you have been able to resolve this problem already. Sorry for the delay.

              Firstly, how are you calling the api from within the MODx Page that you where you are getting the correct results?
                xWisdom
                www.xwisdomhtml.com
                The fear of the Lord is the beginning of wisdom:
                MODx Co-Founder - Create and do more with less.
                • 15426
                • 12 Posts
                Hi Xwisdom,

                I found out that the error was happening when I called the API on a page in another directory than the main index html folder... Don’t really know why, and I could have sworn it was working before so I’m pretty confused on the whole thing. In the end I just put everything in the same folder smiley

                Greg
                  • 1186
                  • 202 Posts
                  Hello,

                  I’m using the MODx API library and something seems not working. Here is the problem :
                  Rub 1
                   - Doc 1	          id=1, alias-1.html
                   - Doc 2 (link)		  id=2 => forward to id=4
                   
                  Rub 2
                   - Doc 3		  id=3, alias-3.html
                   - Doc 4 	          id=4, alias-4.html
                  


                  "Doc 2" is a link type document, which points to Doc 4. Thus, in the "link" field of Doc 2, I put [~4~].

                  Wayfinder works fine with that : all aliases are well generated.

                  But if I call Wayfinder using the MODx API library from a page external to the MODx site, like that :
                  $modxmenu = $modx->runSnippet('Wayfinder', array('startId' => '0', 'outerTpl' => 'mh.OuterTpl', 'innerTpl' => 'mh.InnerTpl', 'rowTpl' => 'mh.RowTpl', 'innerRowTpl' => 'mh.InnerRowTpl', 'firstClass' => 'first', 'hereClass' => ''));
                  

                  the alias of Doc 2 (which must be those of Doc 4, alias-4.html) is not generated in the displayed menu ; the mouse over the Doc 2 item in the menu shows : "[~4~]"

                  So it seems that with the MODx API library, the final alias of a link type document is not generated. Is this a bug ?
                    R
                    • 19889
                    • 616 Posts
                    Hello,

                    I was wondering whether this API is still under development or if there is an alternative to it.

                    While I was playing around with the API and Wayfinder, I discovered the following:

                    This works: $html = $modx->runSnippet(’Wayfinder’, array(’startId’=>’0’,’ignoreHidden’=>’false’));
                    This doesn’t work: $html = $modx->runSnippet(’Wayfinder’, array(’config’=>’tch-filelist’));

                    the 2nd attempt lead to this:
                    Start 
                    de [+wf.wrapper.2+] 
                    en [+wf.wrapper.3+] 
                    sitemap 


                    any help to get this working would be very much appreciated;
                      • 22303 MODX Staff
                      • 10,725 Posts
                      It’s not still being developed AFAIK, and as the 0.9.7 API will be usable as a standalone library in a similar way to this library, that is the upcoming alternative.