Pagination and "if" condition Some of my entries have the same entry.title. At the frontend, I would like to display these entries only once. This works with the following code:

{% set entries = craft.entries().section('produkte').relatedTo(category) %}
{% set existingtitle = [] %}
 {% for entry in entries %}
  {% if entry.title not in existingtitle %}        
    {{ Display the Results }}
  {% endif %}
  {% set existingtitle = existingtitle|merge([entry.title]) %}
 {% endfor %}


My question is: How can I then paginate these results? For example 9 entries per page?
If I paginate before the "if" condition gives me not the required result.
Any help or tips are highly appreciated!
You can build an array of the filtered results, then paginate that.

{% set entries = craft.entries().section('produkte').relatedTo(category) %}
{% set filteredEntries = [] %}
{% set existingtitle = [] %}
{% for entry in entries %}
    {% if entry.title not in existingtitle %}
        {% set filteredEntries = filteredEntries|merge([entry]) %}
    {% endif %}
    {% set existingtitle = existingtitle|merge([entry.title]) %}
{% endfor %}


Then modify this code to paginate array: https://gist.github.com/juban/a55781d49f2f68ec3ca47979bcaaa49a