I have created a common page which will be used by two different site, so I can not attach one desig path to this page (etc\design) for dialog configurations. I wanted to dynamically assign the design path to page before it is loading through server side (in sightly class associated to page).
How can I achieve this? Is there any API or setter method I can use to do the same?
Views
Replies
Total Likes
you can use the currentStyle com.day.cq.wcm.api.designer.Style implicit object to get the styles in sightly.
Views
Replies
Total Likes
Is it a possibility to create 2 templates that have your custom page as a resourceSuperType and set the design paths on those 2 templates?
Views
Replies
Total Likes
create one template and use 2 styles from dropdown field in page properties dialog
Views
Replies
Total Likes
Perhaps a nice source to look at is this:
This way you can imply your own custom logic to return a specific design at runtime.
Views
Replies
Total Likes
My question was how to dynamically SET the design path. Reading is no thte problem.
All the above talks about GETing the design path, I want to SET the desing path using code at run time instead giving it as as page property.
Views
Replies
Total Likes
Yes, the example in the link that I provided is a way of dynamically determining a design path, when a page is being requested.
Views
Replies
Total Likes
It is not about determining at run time. I wanted to udpate the the design path at run time.
My page doesn't have desing path, so when page is loaded I wanted to assign it. There are certain conditions based on which at run time I need to setup design path out of multiple design path availble.
All above are talking about reading dynamically, my question is about setting update deisng path dynamically.
Views
Replies
Total Likes
understood, thanks...looking for a probable solution. will keep you posted
Views
Replies
Total Likes
I'm guessing you're not quite getting the point of what I'm trying to say here.
In the link I provided, you can write some custom code to create an injector that you can use to SET the design of the page to anything you wish, at runtime, without modifying the JCR.
You simply need to return a Design instance, based on the criteria your use case has (e.g.: return Design instance A when the requested path is /content/site1 and return Design instance B if the path is /content/site2)
Views
Replies
Total Likes
THat sounds good, but how. Can you please share some code snippet and API function which can support the setter method of current page design path and at which instance I should inject it? Like when page is laoded there are default classed under WCMUse.
Views
Replies
Total Likes
The link that I provided above is a code snippet on an injector that you need to create yourself. Basically, this injector will react on any kind of resource being requested and allows you to manipulate that resource, before being rendered. Please, first take a good look at that link.
To get a design/style by in Java, you'll have to use a Designer instance (Designer ("The Adobe AEM Quickstart and Web Application.") )
Views
Replies
Total Likes
If you get this working - you should post the solution. It may help a lot of AEM ppl in the future.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies