Hi Reinier,
you can use the XML schema's for developing backend templates (for
business logic, layout), which also contain description (hints) for
allowed elements and attributes:
see
http://repository.hippocms.org/schemas/cms-6.05/editor/businesslogic.xsd
and
http://repository.hippocms.org/schemas/cms-6.05/editor/layout.xsd
Wildcards for xpaths do not work. However, in your case you can use a
type-rule to make a business logic rule which corresponds to a type from
the XML schema. See businesslogic.xsd (url provided above) for more
description. If that doesn't work for you, you can also use "macros" to
prevent duplication of code. An example can be found here (NB: macro's
work for both layout and business logic files) :
http://hippocms.org/display/CMS/Layout+reference#Layoutreference-Repeaterwidget
regards,
Dennis
Reinier van den Born wrote:
Hi,
I'd like to reduce the number of rules I have.
Now I have recurring structures in my document XML, but not always at
the same location.
For instance an alt (alternative text) attribute, whenever I have an
image and images occur in different places.
And I end up copying my rules for each occurrence.
In the documentation, e.g.
http://www.hippocms.org/display/CMS/Template+Business+Logic+definition
the value of the "for" attribute in a rule (<rule for="<...>") is
referred to as an Xpath.
But it doesn't seem I can use wildcards, // and such. Or?
It is also said that rules can be bound to XSD types (type definitions).
Is there any further explanation of how to do this?
Thanks,
Reinier
********************************************
Hippocms-dev: Hippo CMS development public mailinglist
Searchable archives can be found at:
MarkMail: http://hippocms-dev.markmail.org
Nabble: http://www.nabble.com/Hippo-CMS-f26633.html
********************************************
Hippocms-dev: Hippo CMS development public mailinglist
Searchable archives can be found at:
MarkMail: http://hippocms-dev.markmail.org
Nabble: http://www.nabble.com/Hippo-CMS-f26633.html