


I have created a component that outputs a text label and an image. There is also a design setting provided for the template to set something relevant to the presentation. When used on a page, it works fine.
However if I use Sling Dynamic Includes to enhance the component to have SSI with a TTL on it, the component fails. The Style object used to get the design settings is null.
@Injectpublic LogoModel(
@ScriptVariable @Named("currentPage") final Page currentPage,
@ScriptVariable @Named("currentStyle") final Style currentStyle) {
Is this a known limitation of using SDI? Is there another way of loading design mode settings into the model?
Views
Replies
Sign in to like this content
Total Likes
you can access policy nodes by using below code snippets
import org.apache.sling.api.resource.ResourceResolver; import com.day.cq.wcm.api.policies.ContentPolicy; import com.day.cq.wcm.api.policies.ContentPolicyManager; import org.apache.sling.api.resource.ValueMap; // placed within Sling Model or Java-Use API ResourceResolver resourceResolver = resource.getResourceResolver(); ContentPolicyManager policyManager = resourceResolver.adaptTo(ContentPolicyManager.class); ContentPolicy contentPolicy = policyManager.getPolicy(resource); ValueMap policyValues = contentPolicy.getProperties();
thanks,
aruna
you can access policy nodes by using below code snippets
import org.apache.sling.api.resource.ResourceResolver; import com.day.cq.wcm.api.policies.ContentPolicy; import com.day.cq.wcm.api.policies.ContentPolicyManager; import org.apache.sling.api.resource.ValueMap; // placed within Sling Model or Java-Use API ResourceResolver resourceResolver = resource.getResourceResolver(); ContentPolicyManager policyManager = resourceResolver.adaptTo(ContentPolicyManager.class); ContentPolicy contentPolicy = policyManager.getPolicy(resource); ValueMap policyValues = contentPolicy.getProperties();
thanks,
aruna