We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40906
    • 23 Posts
    Hi,

    Im currently working on a website for a local rugby team and i have to make a calendar with some additional information. So basicly what i want to create is a page that shows the team they have to play against, the adress information of the club they have to play against and wich parent has to be the driver for his kid that game.

    I would like modx to have a template variable in witch i can select the team and the designated driver. Modx then automatically gives back the information that belongs to the team and the designated driver. All of the information is placed in a separate document.

    I was thinking about using some sort of GetResources field to get the information out of the other documents when selected.

    I hope my question is clear if not i would like to show u some screenshots of the page to make it clear.

    Hope u guys can help me out.

    Greetings,

    Coen
      • 42146
      • 73 Posts
      i believe your wanting to do something similar to this. I have a a container -> class info, viewing this page lists all the classes offered, i have childerden of class info one resource for each class with multiple tv's. I have another container -> team, lists all instructors. has children resource of each instructor with TV's

      on container class info page
      [[!getResources? 
      &showHidden=`1` 
      &tpl=`Class_Info` 
      &limit=`50` 
      &includeContent=`1` 
      &includeTVs=`1` 
      &processTVs=`1` 
      &parents=`[[*id]]` 
      &sortdir=`ASC` 
      &sortby=`pagetitle` 
      &hideContainers=`1`]]


      Class_info TPL
      <div class="Class_Info">
      
      
      <a name="[[+pagetitle]]"></a>
      <h2>[[+pagetitle]]</h2>
      
      [[+content]]
      <p><b class="emphasis">Instructor</b> 
      <a href="[[~13]]#[[!getResourceField? &id=`[[+tv.Bio_ID]]` &field=`pagetitle`]]">[[!getResourceField? &id=`[[+tv.Bio_ID]]` &field=`pagetitle`]]</a></p>
      
      <p><b class="emphasis">[[+tv.Class_Day]]</b> [[+tv.Class_Time]]</p>
      <p><b class="emphasis">Price:</b> [[+tv.Price]]</p>
      <p><b class="emphasis">[[!getResourceField? &id=`[[+tv.Bio_ID]]` &field=`Phone` &isTV=`1` &processTV=`1` &default=`Sorry, no data available`]]</b>   <a href="mailto:[[!getResourceField? &id=`[[+tv.Bio_ID]]` &field=`BEmail` &isTV=`1` &processTV=`1` &default=`Sorry, no data available`]]">[[!getResourceField? &id=`[[+tv.Bio_ID]]` &field=`BEmail` &isTV=`1` &processTV=`1` &default=`Sorry, no data available`]]</a>  </p>
      <br/>
      </div>


      In the above [[+tv.Bio_ID]] is the id number of the specific instructor resource for the class i manually put in into the tv from the the class page i created.
      [[!getResourceField? &id=`[[+tv.Bio_ID]]` &field=`BEmail` &isTV=`1` &processTV=`1` &default=`Sorry, no data available`]]
      this nested getResourceField call, then can grab whatever field i wanted from the instructors page. in this case it's just the instructors phone and email. not that i think of it not sure if i could get all instructor fields at once vs multiple getResourceField calls...

      there are ways to make the [[+tv.Bio_ID]]TV more dynamic, or a manual created dropdown list.. but i'm not sure how to make it so. easier to just manually enter the instructors page ID.



      for more info on the calls
      http://rtfm.modx.com/display/ADDON/getResources
      http://rtfm.modx.com/display/ADDON/getResourceField

      Hope this helps get you in the right direction

      I'm guessing your wanting a page structure like..
      field - > page for each field with tv's for field info
      Drivers -> page for each driver with tvs for driver info
      team - > pages foe each team with tv's for each team.

      calender page.
      with getResources call,

      in getResources tpl nest getResourceField calls as needed.....