Search This Blog

Saturday 7 September 2019

Add on/off time in page properties for experience fragment's


Publishing Experience fragments


Use case

Activate and deactivate the components on the page instead of deactivating the whole page based on some preconfigured date.

Approach

So basically requirement is to be able to configure on/off time for experience fragments similar to how its done for cq:page.
OOTB on/off time is not available in the page properties dialog of the experience fragments.

Hypothesis was if we add the on/off time in the page properties of the experience fragments it should work seamlessly like it works for normal pages as experience fragments is also cq:page resourcetype.




Implementation

Overlay xf dialog from /libs/cq/experience-fragments/components/xfpage/cq:dialog  to /apps/<project>/components/structure/xfpage/cq:dialog and add on/off time fields to it.



1.     Copy the dialog from /libs/cq/experience-fragments/components/xfpage/cq:dialog  inside the custom xf component.




2.     Add the on/off date fields remaining stuff. Sling resource merger would render the merged output of the libs and apps dialog.


Works seamlessly as expected!

No comments:

Post a Comment