Question:
Is it posible if i want to set a cq5 component C editable in page A, but not editable in page B.
Solution:
You can set ComponentContext.BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE before the include, and remove it after the include.
slingRequest.setAttribute(ComponentContext. BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE, true);
<sling:include component C/>
slingRequest.removeAttribute(ComponentContext. BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE);
|
Ref: https://dev.day.com/docs/en/cq/current/developing/boilerplates.html
Nhận xét
Đăng nhận xét