Hi @toimrank,
We can write a query to get the style node (configured as policy) with the Id from the component node available under respective page content.
(Style node in policy will have details of style label, style class and style id - Sample screenshot for reference below)
Sample query:
path=/conf/yourproject/settings/wcm/policies
type=nt:unstructured
1_property=cq:styleId
1_property.1_value=1590089010715
1_property.2_value=1590089575644
p.limit=-1
Where
- path can be refined to specific component policy under main"policies" path based on the need
- property.value predicate to be framed dynamically from the component node available under the desired content path(cq:styleIds - String[])
For how many ever style Ids you have, frame property.value predicates accordingly. - Returned query result set will be the highlighted node and hence access to style label and class.
To be implemented in Sling Models or WCMUsePojo and expose the style class via getters for access in sightly.
Screenshot for reference:
