Skip to content

Add data-ps-fragment markers to dynamic fragments - #1101

Open
Codencode wants to merge 1 commit into
PrestaShop:2.xfrom
Codencode:feature/add-dynamic-fragment-markers
Open

Add data-ps-fragment markers to dynamic fragments#1101
Codencode wants to merge 1 commit into
PrestaShop:2.xfrom
Codencode:feature/add-dynamic-fragment-markers

Conversation

@Codencode

@Codencode Codencode commented Sep 8, 2026

Copy link
Copy Markdown
Member
Questions Answers
Description? Adds semantic data-ps-fragment markers for notifications and product-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 notifications container 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-fragment attribute is also documented in CONTEXT.md as part of Hummingbird's semantic data-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.
Type? improvement
BC breaks? no
Deprecations? no
Fixed ticket?
Sponsor company Codencode snc
How to test? 1. Use the Hummingbird theme with the changes from this PR.
2. Open a product page and verify that the product-add-to-cart container contains data-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.

@Codencode

Copy link
Copy Markdown
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 data-ps-fragment markers instead of adding dedicated before/after hooks to the theme, with the related LiteSpeed implementation in litespeedtech/lscache_prestashop#107.

Do you think this direction addresses the concerns you raised on #988? Any feedback or suggestions would be very welcome.

@Codencode
Codencode marked this pull request as draft September 8, 2026 19:19
@Codencode
Codencode force-pushed the feature/add-dynamic-fragment-markers branch from 9b98037 to 110977d Compare September 9, 2026 05:29
@Codencode
Codencode marked this pull request as ready for review September 9, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

2 participants