We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25551 ☆ A M B ☆
    • 1,231 Posts
    I really don’t know what to do... the info seems to be in the console and it’s showing what i need it to. I just don’t know how to use this info and have it displayed in a document.

    I’ve upped the saved debug console and maybe you could see what i need to do. I’ve looked at the other preset templates but i just can’t see how to fit it to what i have in the debug.

    Thanks.
      Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
      AugmentBLU - MODX Partner

      BLUcart - MODX Revolution E-Commerce & Shopping Cart
      • 11975
      • 2,542 Posts
      Hi,

      First open the debug console and click on the template buider tab.
      All infos are there.

      here are the first steps:

      Create a folder named "league" in assets/snippets/feedx/tpl/
      Change in your call &preset=`league`

      Then create the root tpl obligatory named outer.tpl
      Insert in this file:


      {{TEAM->team}}

      Create another file named team.tpl


      {{TEAMINFORMATION->teaminformation}}
      {{COMPETITIONINFORMATION->competinformation}}

      teaminformation.tpl content:


      [+NAME+]
      [+URL+] [+EMAIL+] [+IRC.CHANNEL+]
      [+STATUS+] [+FOUNDER+]

      And so on ...

      Follow the path according the tables in template builder.

      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 25551 ☆ A M B ☆
        • 1,231 Posts
        Thanks! I think i can do that... i’ll check back if i get stuck. Thanks!
          Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
          AugmentBLU - MODX Partner

          BLUcart - MODX Revolution E-Commerce & Shopping Cart
          • 11975
          • 2,542 Posts
          There are errors in my previous post.

          You don’t need the .tpl
          {{TEAM->team}} is enough.

          :-)
            Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
            • 25551 ☆ A M B ☆
            • 1,231 Posts
            Ok, so which would be the best way to show this info on my website? I know there are nuke scripts out there that can use the xml but how would i have this info displayed on a page? I don’t mind if i have to use a 3rd party script or have to manage it outwith modx. I just want to beable to display the info from that feed on e webpage so you can make out what it’s displaying easily. I.E in the categories.

            Thanks.
              Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
              AugmentBLU - MODX Partner

              BLUcart - MODX Revolution E-Commerce & Shopping Cart
              • 25551 ☆ A M B ☆
              • 1,231 Posts
              So far i have this...

              http://www.err-clan.com/index.php?id=153

              Using the snippetcall

              [!FeedX? &preset=`league` &url=`http://www.teamwarfare.com/xml/viewteam_v2.asp|xq|team|xe|EliteRedBoneRangers` &caheTime=`3600` &debug=`1`!]


              I want to include all the info in the xml but how do i call the matchtpl for example to show the next match?






                Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                AugmentBLU - MODX Partner

                BLUcart - MODX Revolution E-Commerce & Shopping Cart
                • 25551 ☆ A M B ☆
                • 1,231 Posts

                <?php
                
                $feedURL = 'http://www.teamwarfare.com/xml/viewteam_v2.asp?team=EliteRedBoneRangers';
                $pXML = simplexml_load_file($feedURL);
                $rank = $pXML->xpath('//rank');
                $matchDate = $pXML->xpath('//matchdate');
                echo "Rank: {$rank[0]} <br />";
                echo "Match date: {$matchDate[0]} <br /><hr noshade />";
                
                $ladderRoster = $pXML->competitioninformation->ladder->roster;
                $playersCount = count($ladderRoster->player);
                
                for($c=0; $c < $playersCount; $c++) {
                	echo "Player name: {$ladderRoster->player[$c]['name']}<br />";
                	echo "Join date: {$ladderRoster->player[$c]->joindate}<br />";
                	echo "Position: {$ladderRoster->player[$c]->position}<br />";
                	echo "<a href=\"{$ladderRoster->player[$c]->links->htmllink}\">Link</a><br /><hr noshade />";
                }
                
                ?>
                


                I’m not very good with coding so you’ll need to excuse my ignorance lol.

                Would i just put this in a snippet on it’s own? And then use a snippet call?

                I appreciate all the help so far.
                  Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                  AugmentBLU - MODX Partner

                  BLUcart - MODX Revolution E-Commerce & Shopping Cart
                  • 25551 ☆ A M B ☆
                  • 1,231 Posts
                  Hey, yeah i stuck the full php script in a snippet. [twl]

                  I used a simple [!twl?!] call

                  It’s outputting something which is good!

                  http://www.err-clan.com/index.php?id=156

                  You can see the info here.

                  Could you tell me how i would tyle the feed to make it look better?

                  I’ve never worked with xml. Thanks
                    Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                    AugmentBLU - MODX Partner

                    BLUcart - MODX Revolution E-Commerce & Shopping Cart