Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hi,

I am looking to have show the result of the previous fixture and the next upcoming game for our football (soccer) club.
I think I'm making progress and then I'll try something else and I'm back to square one. It's beginning to drive me up the wall.
I've put code below. My thinking is I need to offset the found page but am unsure if a. that's the case and b. if it as simple as offset="1"

Code: Select all
<!--Get Today's Date-->
<cms:set current_date="<cms:date format='Y-m-d H:i:s' />" />
<section class="previous-fixture">
  <h1>Previous Result</h1>
  <cms:pages masterpage="fixtures.php"
             limit="1"
            orderby="<cms:get_custom_field kickoff />"
           order="asc">
    <cms:if current_date gt kickoff>
      <div class="fixture-date"><h3><cms:date kickoff format="jS F, Y" /></h3></div>
      <ul>
        <li>
         <div class="cell">
            <cms:related_pages "home_team"><cms:show k_page_title /></cms:related_pages>
         </div>
         <div class="cell">0</div>
         <div class="cell">
            <cms:related_pages "away_team"><cms:show k_page_title /></cms:related_pages>
         </div>
         <div class="cell">3</div>
         <div class="cell"><cms:show competition /></div>
      </li>
      </ul>
      <cms:else />
      <p style="margin-left:10px;">No fixtures have been played this season.</p>
   </cms:if>
</cms:pages>


Any help greatly appreciated.

Ian
Hi,

Please try the following and let me know if it helps -
Code: Select all
<!--Get Today's Date-->
<cms:set current_date="<cms:date format='Y-m-d H:i:s' />" />

<cms:pages orderby='kickoff' order='asc' custom_field="kickoff > <cms:show current_date />" limit='1'>
    <a href="<cms:show k_page_link />">Next</a>
</cms:pages>

<cms:pages orderby='kickoff' order='desc' custom_field="kickoff < <cms:show current_date />" limit='1'>
    <a href="<cms:show k_page_link />">Prev</a>
</cms:pages>
Seems to have done the trick. Thank you KK.
Once step closer to complete and purchasing a license.

:D :D
3 posts Page 1 of 1