We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20575
    • 36 Posts
    Hello! I have just created a simple blog using ditto and it works fine. The only bit i’m stuck on is how to style the placeholders such as [+pages+] and especially [+previous+]. I just want to space out the page numbers and add a class to the previous and next so they look like my other links. I am using the latest modx with Ditto 2.1.0. Can anyone help please?

    Thanks in advance.
      • 27672
      • 168 Posts
      looking at the source code of one of my ditto blogs i see:
      <div id="ditto_pages"><span class="ditto_previous_off ditto_off">< Previous</span> <span class="ditto_currentpage">1</span><a class="ditto_page" href="/blog?start=6">2</a><a class="ditto_page" href="/blog?start=12">3</a><a class="ditto_page" href="/blog?start=18">4</a><a class="ditto_page" href="/blog?start=24">5</a><a class="ditto_page" href="/blog?start=30">6</a> <a href="/blog?start=6" class="ditto_next_link">Next ></a></div>

      and the styling for those links is:
      div#content div#ditto_pages{
      padding:15px 0 5px 0;
      margin:0;			
      font-size:11px;
      }
      div#content div#ditto_pages a, 
      div#content div#ditto_pages span.ditto_off,
      div#content div#ditto_pages span.ditto_currentpage{
      padding-right:3px;
      padding-left:3px;
      }
      

      note: div#content was needed to overwrite some other styles, so you probably won’t need that part, or you could change it to whatever your content container div is called. in firefox try highlighting the links, right-click and choose "view selection source" to see what divs/spans/etc are making up the links/text.
        • 20575
        • 36 Posts
        Many thanks for the help!
          • 16278
          • 928 Posts
          As well as using pure CSS styling, you can set the content of the placeholders with template chunks indicated by some pagination-specific parameters, each of which can be given as a chunk name or an HTML string. This is particularly useful for spacing out the list of page links without depending on CSS:
          &tplPaginateNext
          Template for [+next+]

          &tplPaginatePrevious
          Template for [+previous+]

          &tplPaginateNextOff
          Template for inactive [+next+]

          &tplPaginatePreviousOff
          Template for inactive [+previous+]

          &tplPaginatePage
          Template for page links in [+pages+]

          &tplPaginateCurrentPage
          Template for the current page link in [+pages+]
          Example at http://www.pogwatch.com/ditto/ditto-pagination.html
          smiley
            • 20575
            • 36 Posts
            Excellent thanks a lot for the help! smiley