-
Notifications
You must be signed in to change notification settings - Fork 290
feat: Add article about adding custom header and footer #1753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
How will dynamic access work for the navigation that way, when no rules (which feels like page data to me) can influence navigation elements? I assume people built similar things and need to understand. Otherwise we will just find plugins in the store, that disable the use of ESI as it is like this in the documentation |
While I understand the motivation behind introducing ESI for header and footer – longer cache lifetime and better performance – I see a critical issue that must be addressed, especially in the context of Shopware's large and diverse plugin ecosystem. The current solution forces developers to either remove ESI entirely or move all customizations into the Let me illustrate this with a realistic scenario: Example Extension 1 – Shopware 6.6:
(dynamic means: custom field output, controller response, login state-dependent content, etc.) Now, with ESI, this approach breaks. Example Migration of Extension 1 – Shopware 6.7:
So far, so good – until another extension enters the game. Example Extension 2 – Shopware 6.7:
As a result, Extension 1 and its content are gone. This is a real issue, not just a theoretical one. In a plugin-rich environment like Shopware's, this pattern creates massive incompatibilities and makes it impossible to rely on layered inheritance – one of the key features of the Twig templating system and the Shopware theme system.
Therefore, I ask you to actively address this issue again. And if that is not an option, add more granular blocks within the ESI-loaded header and footer templates. For example:
This would mirror the previous block structure and allow multiple plugins to safely inject their content without overwriting each other or breaking ESI logic. This ESI approach, while technically elegant, has not been fully thought through in terms of developer experience and plugin compatibility. Given Shopware's commitment to extensibility, this decision needs to be revisited – or at least softened – before 6.7 reaches stable release. Let’s not sacrifice the flexibility of the system in favor of a performance gain that might only be marginal in real-world setups. |
Another important point to consider is how long this kind of implementation can realistically hold in a system as modular and extensible as Shopware. Given the sheer number of extensions and custom implementations out there, it’s very likely that every second or third project will contain at least one plugin that modifies the header or footer in a way that renders the ESI include unusable or is forced to override it. If enough plugins disable or bypass the ESI logic to keep their features working, the intended performance benefits are quickly lost across the ecosystem – and the ESI integration becomes more of a theoretical construct than a practical solution. In other words: If this approach isn’t easily extendable and conflict-safe, it won’t be widely adopted. And if most developers end up turning it off, the effort might have been in vain. |
hey @david-strauch thanks again for your valid feedback. We will revisit this again, as already mentioned in the issue. |
@JoshuaBehrens Dynamic Access works out of the box. As soon as a rule is applied, the cache is disabled (cart and customer stuff) |
A bit sad but I can understand, that one does not want to have super many permutation of rule ids in cache keys |
381184e
to
f9d7449
Compare
f9d7449
to
de5ecdf
Compare
de5ecdf
to
5ebcb0a
Compare
hey @JoshuaBehrens @david-strauch I updated the article due to the latest changes I made here: shopware/shopware#8827 Would be cool, if you could have a look again |
@mitelg For me, this works. I'm glad we found such a good solution. 🙌 Thanks to everyone for looking into this and coming up with a solution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for the PR @mitelg 👍
* feat: v6.7.0.0-dev * NEXT-37105 - new payment handling for 6.7 (#1426) Co-authored-by: Bojan Rajh <[email protected]> * typo: Update add-payment-plugin.md (#1611) * typo: Update add-payment-plugin.md fixes typo on calling the transactionStateHandler obj * fixes 3 more same typo * Http cache clearing (#1693) * Update cache clearing methods * Clarify versions * Fix markdown --------- Co-authored-by: Micha <[email protected]> * docs: adjust performance tweaks for 6.7 update (#1705) * docs: enhance licensing and feature management information in commerc… (#1675) * docs: enhance licensing and feature management information in commercial plugin * Apply suggestions from code review Co-authored-by: Micha Hobert <[email protected]> --------- Co-authored-by: Micha Hobert <[email protected]> * NEXT-39755 - Update messenger docs to use default symfony bus (#1584) * feat: remove workflows (#1698) * feat: remove workflows * fix: guidelines * fix: guidelines * fix: lint * Update add-custom-commands.md (#1699) There was one class missing in the "use Symfony\Component\Console\Attribute\AsCommand" class, which is generating an error like the following: The command defined in "NameSpace\Of\MyClassCommand" cannot have an empty name. * adhoc/update-hash * Update add-menu-entry.md (#1702) * FIX: wrong key in object-stroage config in filesystem.md (#1696) "options:" does not exist anymore in config and was not removed here but later in the docs. This will result in an "access denied" error as soon as file system calls are made, despite valid credentials. * docs: adjust performance tweaks for 6.7 update * Fix wordlist and markdown --------- Co-authored-by: Shyim <[email protected]> Co-authored-by: Micha Hobert <[email protected]> Co-authored-by: Aydin Hassan <[email protected]> Co-authored-by: Bojan Rajh <[email protected]> Co-authored-by: Mohammad Bharmal <[email protected]> Co-authored-by: Philipp Bucher <[email protected]> * fix: Links to manifest file for Shopware 6.7 (#1708) * fix: unlock adr to trunk * [create-pull-request] automated change (#1712) Co-authored-by: shopwareBot <[email protected]> * Update add-cookie-to-manager.md (#1719) Fix wrong namespace in example. * update admin asset usage guide (#1714) * fix: Improve article about adding data to the storefront (#1725) * fix: Improve article about adding data to the storefront * Update guides/plugins/plugins/storefront/add-data-to-storefront-page.md Co-authored-by: Albert Scherman <[email protected]> * chore: Update the articles where a StorefrontController is used (#1734) * chore: Update the articles where a StorefrontController is used Using `setTwig` is no longer necessary. References about header and footer in custom page objects are also removed. As they are no longer part of the generic page. * fix code blocks * fix: broken rendering * chore: remove ADR change * chore: add code groups --------- Co-authored-by: Micha <[email protected]> * Explain new twig changes while keeping appropriate warnings (#1500) * Explain new twig changes while keeping appropriate warnings * Update resources/references/storefront-reference/twig-function-reference.md * chore: reformat tables and intro --------- Co-authored-by: Micha Hobert <[email protected]> * docs: add caching guide (#1743) * docs: add caching guide * Update guides/plugins/plugins/framework/caching/index.md Co-authored-by: Copilot <[email protected]> * Fix spellcheck * http code block * chore: grammar, language and styling * chore: adjust headlines / toc * Address CR comments * Clearify info * Update guides/plugins/plugins/framework/caching/index.md Co-authored-by: Michael Telgmann <[email protected]> * Update guides/plugins/plugins/framework/caching/index.md Co-authored-by: Michael Telgmann <[email protected]> --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Micha <[email protected]> Co-authored-by: Michael Telgmann <[email protected]> * chore: add updated AppScript reference (#1726) * feat(theme-config): Add documentation regarding labels and helpTexts for the theme manager (#1770) * fix: getRequest is not part of HttpCacheKeyEvent (#1768) * feat: Add article about adding custom header and footer (#1753) * chore: Improve current articles regarding header and footer changes * feat: Add article about adding custom header and footer * chore: grammar-and-language --------- Co-authored-by: Micha <[email protected]> * Update guides/plugins/plugins/storefront/customize-templates.md * chore: remove-watcher (#1771) * docs: add section about disabling scheduled sitemap generation (#1794) * docs: add section about disabling scheduled sitemap generation - Explain that sitemap generation can block the message queue - Show how to disable the scheduled task - Provide example cronjob setup - Available starting with Shopware 6.7.1 Related to shopware/shopware#10403 * fix: markdown linting and add cronjob to wordlist - Add blank line before list to fix MD032 linting error - Add 'cronjob' to .wordlist.txt for spell-check * chore: version-consistency --------- Co-authored-by: Micha <[email protected]> * docs: context gateway (#1789) * docs: context gateway * docs: add reviewer feedback * fix: linting * fix: remove lock files * Update guides/plugins/apps/gateways/context/command-reference.md * Update guides/plugins/apps/gateways/context/context-gateway.md * Update guides/plugins/apps/gateways/context/context-gateway.md * Update guides/plugins/apps/gateways/context/context-gateway.md * Update guides/plugins/apps/gateways/context/context-gateway.md * Update guides/plugins/apps/gateways/context/context-gateway.md * Update guides/plugins/apps/gateways/context/context-gateway.md --------- Co-authored-by: Su <[email protected]> * feat: Hint that hardcoded prefixes are no longer necessary (#1799) --------- Co-authored-by: Lennart Tinkloh <[email protected]> Co-authored-by: Panagiotis Koursaris <[email protected]> Co-authored-by: Aydin Hassan <[email protected]> Co-authored-by: Micha <[email protected]> Co-authored-by: Jonas Elfering <[email protected]> Co-authored-by: Shyim <[email protected]> Co-authored-by: Mohammad Bharmal <[email protected]> Co-authored-by: Philipp Bucher <[email protected]> Co-authored-by: Michael Telgmann <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: shopwareBot <[email protected]> Co-authored-by: Marc <[email protected]> Co-authored-by: Benedikt Schulze Baek <[email protected]> Co-authored-by: Albert Scherman <[email protected]> Co-authored-by: Joshua Behrens <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Max Stegmeyer <[email protected]> Co-authored-by: Marcel Brode <[email protected]> Co-authored-by: tinect <[email protected]> Co-authored-by: Su <[email protected]>
Due to ESI loading customizing the header and footer does not work like in SW6.6 anymore. This should explain on how to extend them with SW6.7
Closes shopware/shopware#8604