How would I use design dialogs on a componet to create a global setting and not a setting that is bound per template? I want to save a property for a component globably and not have 5 different references if I have 5 templates. How can I create a component that has a global configurable setting?
We've sometimes used inheritance in cases like this - check for the value in the current page and if it doesn't exist, check for the value in the getAbsoluteParent(2) page node. The down side of this is a bit of node walking and a lot of null checking.
One approach would be to have multiple templates using the same design. That would allow you to use a design dialog for this.
Another approach is to have an absolutely referenced global node. So your tag looks like <cq:include path="/content/siteName/globalText" resourceType="appName/components..." />. Obviously you may need to have sort of a wrapper component if the intent is to use this to be dragged onto a parsys.
Actually, you might be able to use an absolute path in the "name" property of your dialog widget. I haven't tried that...
Yes, by default data in design mode are stored separately per template.
For example there is logo component in sample geometrixx app which also stores logo per template,
At the same time there is inheritance implemented in design mode, so if all your templates inherits from some basic/abstract template (in case of geometrixx it is 'page' template) you can store design properties once and they will be inherited by all templates.
I think what you can do is to override the path where data is stored, e.g. in logo.jsp component you can do that by settingt content path on editContext variable
from now data will be stored under given path regardless of actual template used (here under 'abstract' page template)
Europe, Middle East and Africa