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

    I’ve just noticed that clicking pages past page one or clicking the next button causes my footer to disappear. I’m pretty sure this wasn’t occurring before so I’ve obviously done something to stuuf things up!

    I’ve retraced my steps and removed anything new such as the DItto tagging but nothing seems to work.

    Does anyone know what might cause this to happen? Heres the Ditto call I’m using:
    [!Ditto? &parents=`43` &tpl=`sectionHomeNews` &showInMenuOnly=`1` &sortDir=`DESC` &paginate=`1` &display=`2` &paginateAlwaysShowLinks=`0` &tagData=`tags` &tagDocumentID=`55`!]


    Any suggestions would be most welcome...

    Cheers

    Ben
      • 5532
      • 251 Posts
      OK, I’ve removed 5 chunks, 2 ditto calls, 1 snippet (dateTime) and 1 plugin (PHx) so I’m pretty sure it wasn’t something I added after getting pagination running.

      I’m thinking it must be something to do with the pagination Ditto call or the template used from the call.

      Here’s the simplified Ditto call I’m now using for troubleshooting:
      [!Ditto? &parents=`43` &tpl=`sectionHomeNews` &paginate=`1` &display=`2` &paginateAlwaysShowLinks=`0`!]


      Here’s the template sectionHomeNews:
      <div class="textBlock1 news">
      <div class="fadeSmall">
      <a href="[~[+id+]~]"><h2>[+title+]</h2></a>
      <p>[+textBlock1:limit=`300`+]...</p>
      <p><a class="small green button" href="[~[+id+]~]">Read the full article »</a></p>
      </div>
      </div>


      Here’s the div that contains the pagination link code from the main news page:
      <div class="textBlock1">[+previous+]<span class="ditto_page">PAGE:</span>[+pages+][+next+]</div>


      I have that sinking feeling that this is something really simple that I’m not seeing!
        • 5532
        • 251 Posts
        I don’t fully understand caching but read that it can make a difference to Ditto however, toggling "Cacheable" for the news page didn’t change anything...
          • 5532
          • 251 Posts
          OK, have remembered that the footer is created using a Ditto call (so I can use one footer for the entire site) which maybe means there’s a conflict when pagination is used?

          Although, the footer hasn’t been touched for a couple of weeks so not sure why it’s suddenly disappearing when pagination is used - it’s fine everywhere else.

          Just incase someone can see something, here’s the footer ditto call:
          [!Ditto? &documents=`25` &tpl=`siteWideFooter`!]


          And here’s the template chunk used in the above call:
          <!-- START BREADCRUMBS -->
          <div id="breadcrumbWrap">
          <div id="breadcrumbContainer" class="centre">
          <a href="[~[(site_start)]~]" title="[(site_name)]">Home</a>
          [[Breadcrumbs? &showHomeCrumb=`0` &crumbSeparator=` `]]
          </div>
          <!-- END BREADCRUMBS -->
          </div>
          
          
          
          <!-- START FOOTER -->
          <div id="footerWrap">
          <div id="footer" class="centre">
          
          <!-- START TEXT BLOCKS -->
          <div class="textBlock4">
          [+textBlock1+]
          </div>
          
          <div class="textBlock4">
          [+textBlock2+]
          </div>
          
          <div class="textBlock4">
          [+textBlock3+]
          </div>
          
          <div class="textBlock4">
          [+textBlock4+]
          </div>
          <!-- CLEAR FLOATS ABOVE -->
          <br class="clearFloat"></br>
          
          <div class="textBlock1 copyright">
          <p>[+footerCopyright+]</p>
          </div>
          
          </div>
          <!-- END FOOTER -->
          </div>

            • 16278
            • 928 Posts
            You need to give each Ditto call an ID, and prefix your pagination placeholders with the relevant ID plus underscore:
            [!Ditto? &id=`news` &parents=`43` &tpl=`sectionHomeNews` &paginate=`1` &display=`2` &paginateAlwaysShowLinks=`0`!]

            <div class="textBlock1">[+news_previous+]<span class="ditto_page">PAGE:</span>[+news_pages+][+news_next+]</div>
            (Do you want [+news_page+] here? [+pages+] is a hyperlinked list of all the pages)
            Regarding cacheing, it depends on whether you have the PHx plugin installed and active. See http://www.pogwatch.com/ditto/ditto-pagination.html for more details and examples.
            smiley KP
              • 5532
              • 251 Posts
              Thanks you so much - it worked like a charm!

              Just so I understand things a bit better, does this mean I should use IDs on all Ditto scripts to avoid conflicts or just when using Ditto extenders like tagging?

              Cheers

              Ben

                • 16278
                • 928 Posts
                You only have to specify IDs when you have two Ditto calls on the same page, which is what you have: one in your "resource", and one generated by your template for the footer. They’re in the same output page, even though you see them on separate pages in the manager.

                If you have several calls and don’t specify IDs, I think that all of them will have the same default ID of "ditto", and their placeholders can overwrite each other.
                smiley KP
                  • 5532
                  • 251 Posts
                  I guess it’s been blind luck I haven’t had problems before now!

                  Thanks for the info, most helpful - nice info on your site too.

                  Cheers

                  Ben