Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 30, 2025

Users need a way to navigate from blog detail pages back to listing pages, but the correct listing page is ambiguous when multiple exist.

Changes

Backend configuration:

  • Added showBackButton and backButtonUrl config options to blog-detail CMS element
  • Disabled by default for backward compatibility

Admin UI:

  • Added configuration fields in block settings with contextual help text
  • URL field disabled when back button toggle is off

Storefront template:

  • Renders button above article content when enabled
  • Uses custom URL if provided, otherwise falls back to history.back()
  • Security: implements as <button onclick="history.back()"> instead of javascript: URL

Translations:

  • German: "Zurück zum Listing"
  • English: "Back to listing"

Usage

{# Renders when showBackButton=true #}
{% if showBackButton %}
    <div class="werkl-blog-detail-back-button mb-3">
        {% if backButtonUrl %}
            <a href="{{ backButtonUrl }}" class="btn btn-secondary">
                {{ 'werkl-blog.detail.backButton.text'|trans }}
            </a>
        {% else %}
            <button type="button" class="btn btn-secondary" onclick="history.back()">
                {{ 'werkl-blog.detail.backButton.text'|trans }}
            </button>
        {% endif %}
    </div>
{% endif %}
Original prompt

This section details on the original issue you should resolve

<issue_title>Zurück zum Blog Listing</issue_title>
<issue_description>Hallo zusammen, hat jemand ne Idee wie ich einen "Zurück" Button auf der Blog Detail Page implementieren könnte um auf das Blog Listing zurück zu kommen?

Tausend Dank <3 </issue_description>

Comments on the Issue (you are @copilot in this section)

@7underlines Schwierig da auf der Blog-Detailseite nicht ohne weiteres klar ist was die Korrekte Listing-Seite wäre wenn es mehrere davon gibt. Wenn es ganz unsauber sein darf kannst du es einmal wie folgt versuchen: ```html Zurück ``` @7underlines Eine Variante ist es den Link auf die entsprechende Listing-Seite manuell im Detail-Template zu setzen.

Image</comment_new>
<comment_new>@7underlines
Suchst du hier noch immer nach einer Lösung?</comment_new>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 30, 2025 20:55
Co-authored-by: 7underlines <17121556+7underlines@users.noreply.github.com>
Co-authored-by: 7underlines <17121556+7underlines@users.noreply.github.com>
Copilot AI changed the title [WIP] Add back button to blog detail page Add configurable back-to-listing button for blog detail pages Dec 30, 2025
Copilot AI requested a review from 7underlines December 30, 2025 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zurück zum Blog Listing

2 participants