0

when I use the pagination inside the exp:tag:entries-loop the links generated look like

xy.com/blog/tag/Tipps%20für%20Lehrer/P10

instead of

xy.com/blog/tag/Tipps+für+Lehrer/P10

It's exactly the same problem which is asked here (but not solved), except I am not using stash. Thread-starter Davor Peic tried with a spartanic clean template and had the same problem.

Therefore I do not molest you with my code but just want to ask if you could verify that this is a bug or not. Thanks.

1

This is also issue with EE pagination, which Tag uses: if you use the same URL, eg http://example.com/entries/two+apples with pagination in {exp:channel:entries}, the pagination URL can become http://example.com/entries/two apples. Spaces in URLs render as %20 in the address bar, which is the URL entity equivalent of a space.

There is possibly a way to prevent + to convert to a space by making trial-and-error changes in .htaccess, but another method could be to enable PHP in your templates and put a search & replace function to convert spaces to + in pagination urls:

<?php echo str_replace(' ', '+', '{pagination_url}'); ?>

I posted this answer in the wrong thread earlier, but answering your follow-up question, you can use PHP, but plugins (of the search & replace type) might be able to do the same. Unfortunately this issue is because if the EE pagination library, and how it handles the generation of pagination code.

3
  • Thanks for your answer; so that means that in every case you use the default websafe-separator "+" you have to use php to generate correct URLs in the pagination?
    – BNetz
    Apr 3 '15 at 13:22
  • You can use PHP, but plugins (of the search & replace type) might be able to do the same.
    – Solspace
    Apr 5 '15 at 23:43
  • Thanks, this did the trick! I would have wished that I don't need to use PHP for a feature that is very basic and fundamental; perhaps you could integrate the solution in a further update of Tag.
    – BNetz
    Apr 6 '15 at 19:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.