Add data-ps-fragment markers to dynamic fragments - #1101
Open
Codencode wants to merge 1 commit into
Open
Conversation
Member
Author
|
@tblivet I’d be interested in your thoughts on this approach, especially since you had some concerns about the previous hook-based solution in #988. This PR moves to semantic Do you think this direction addresses the concerns you raised on #988? Any feedback or suggestions would be very welcome. |
Codencode
marked this pull request as draft
September 8, 2026 19:19
Codencode
force-pushed
the
feature/add-dynamic-fragment-markers
branch
from
September 9, 2026 05:29
9b98037 to
110977d
Compare
Codencode
marked this pull request as ready for review
September 9, 2026 07:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
data-ps-fragmentmarkers fornotificationsandproduct-add-to-cart, allowing integrations to identify dynamic blocks from the final HTML without adding dedicated before/after hooks or cache-specific logic to the theme.The markers are applied directly to the existing block containers. The
notificationscontainer is always present, even when empty, so the fragment can be identified when the page is initially generated and handled dynamically on subsequent cached requests.The
data-ps-fragmentattribute is also documented inCONTEXT.mdas part of Hummingbird's semanticdata-ps-*attributes.The related LiteSpeed Cache implementation is available in litespeedtech/lscache_prestashop#107 and depends on these markers to isolate the dynamic blocks from the full-page cache and regenerate them through ESI.
This approach replaces the dedicated theme hooks previously proposed in #988. If this PR and the related LiteSpeed Cache PR are merged, #988 can be closed.
2. Open a product page and verify that the
product-add-to-cartcontainer containsdata-ps-fragment="product-add-to-cart".3. Verify that the notifications area is wrapped with
data-ps-fragment="notifications"even when there are no notifications.4. Check that the page renders normally and that the Add to cart block and notifications keep their existing behavior.