# Product Carousel and Related Products follow layout rendering mode

**Date**: 2026-04-28  
**Support Ticket**: N/A

**What Changed:**

- `includes/modules/ProductCarousel/ProductCarousel.php` — Added mode-aware custom layout output so Product Carousel uses standard rendering when selected and strict rendering when compatibility mode is selected.
- `includes/modules/et_pb_db_related_products/et_pb_db_related_products.php` — Added the same mode-aware custom layout output behavior for Related Products, including no-results custom layout output.
- `changelog.txt` — Added a user-facing MOD line explaining that Product Carousel and Related Products now follow Layout Rendering Mode when available.

**Why:**

- BodyCommerce bundles Ajax Filter, and users expect custom loop modules to follow the same layout rendering mode setting for performance and troubleshooting consistency.

**Context:**

- Divi Machine and Ajax Filter modules already support mode-aware layout rendering (standard fast path vs compatibility strict path).
- BodyCommerce modules that render custom loop layouts should align with that behavior so the same setting has consistent effect across packaged modules.

**Technical Details:**

- Each module now resolves rendering mode through `de_daf_use_standard_layout_rendering()` when available.
- If the helper is unavailable, modules fall back to reading `divi-ajax-filter_options` (`daf_layout_rendering_mode`, then legacy `daf_trust_layout_output`).
- Standard mode outputs with Divi-native `et_core_esc_previously(...)`.
- Compatibility mode keeps strict output sanitization (`wp_kses_post(...)` / `de_safe_output_svg(...)`).

**Related:**

- Changelog entry: Product Carousel and Related Products follow Layout Rendering Mode when available.
- Files: `includes/modules/ProductCarousel/ProductCarousel.php`, `includes/modules/et_pb_db_related_products/et_pb_db_related_products.php`, `changelog.txt`

**Notes:**

- ⚠️ Keep the fallback to legacy `daf_trust_layout_output` to preserve behavior on older saved settings.
- ⚠️ Keep compatibility-mode sanitization paths intact; standard mode is optional and settings-driven.
