We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9122
    • 27 Posts
    I’m using the TvTagCloud snippet and Ditto to create a tag based navigation with pagination using user defined tags. I’m having a problem with the Ditto pagination when a tag value contains a single or double quote.

    Here’s an example of the problem with the tag value contains a single quote for the tag Mother’s Day:
    The links on the tag cloud page are working correctly and produce the following URL:

    index.php?id=20&tags=mother%27s+day

    The problem occurs when trying to navigate to secondary pages using the Previous, Next, or Pages links generated from the [+previous+], [+next+], and [+pages+] placeholders:

    index.php?id=20&tags=mother’s day&start=10

    By the way, the tag value in the database is stored as a single quote as Mother’s Day. Is there a correct way to get Ditto to output the single quote to %27 instead of ’ ?

    Here’s the pagination placeholders and Ditto snippet call that is used on the paginated results pages where I’m having the problem.

    <div id="ditto_pages"> [+previous+] [+pages+] [+next+] </div> 
    <p>
    [[Ditto? &sortBy=`pagetitle` &sortDir=`ASC` &dateSource=`editedon` &dateFormat=`%B %d, %Y` &parents=`19` &total=`all` &depth=`2000` &display=`10` &tpl=`ProjectTagChunk` &extenders=`summary` &tagData=`ProjectTags` &tagDelimiter=`, ` &paginate=`1` &paginateAlwaysShowLinks=`0` &tagSort=`1`]]
    </p>


    I’m hoping to go live with a new site in the next week or so and this is the last issue I need to work through, so any help would be greatly appreciated.
    Thanks.
      • 9122
      • 27 Posts
      Well, I’ve got an update. I’m sure there is a better solution than this one, but I added a few lines to ditto.class.inc.php to decode the html entities in the Previous, Page, and Next pagination links using html_entity_decode(). I added the following lines:

      After line 1084:
      $rNext = html_entity_decode($rNext);

      After line 1088:
      $rPrevious = html_entity_decode($rPrevious);

      After line 1119:
      $pages = html_entity_decode($pages);

      This is working for me now, but I would love to hear from anyone with a better solution.

      Thanks,
      estring