{% if related_pages %}
    <div class="{{ css_classes }}">
        <h3>{{ object.title|default:"Related pages" }}</h3>

        <ul>
            {% for related_page, link_url in related_pages_links %}
                <li>
                    {% if related_page.page %}
                        <a href="{{ related_page.page.get_absolute_url }}">{{ related_page.title|default:related_page.page.title }} <span>{{ link_url }}</span></a>
                    {% else %}
                        <a href="{{ related_page.link }}">{{ related_page.title }} <span>{{ link_url }}</span></a>
                    {% endif %}
                </li>
            {% endfor %}
        </ul>
    </div>
{% endif %}

{% if related_pages %}
    <div class="{{ css_classes }}">
        <h3>{{ object.title|default:"Related pages" }}</h3>

        <ul>
            {% for related_page, link_url in related_pages_links %}
                <li>
                    {% if related_page.page %}
                        <a href="{{ related_page.page.get_absolute_url }}" {% if related_page.new_window %}target="_blank" rel="noopener"{% endif %}>{{ related_page.title|default:related_page.page.title }} <span>{{ link_url }}</span></a>
                    {% else %}
                        <a href="{{ related_page.link }}" {% if related_page.new_window %}target="_blank" rel="noopener"{% endif %}>{{ related_page.title }} <span>{{ link_url }}</span></a>
                    {% endif %}
                </li>
            {% endfor %}
        </ul>
    </div>
{% endif %}

Add template tag for new window
Add template tag for new window
