Include specific attribute or child-element text in breadcrumb rendering
Posted: Tue Jan 08, 2019 10:54 am
Hey everyone,
I don't know if this is a 'Common Problem', so let me know if it should be moved somewhere else.
In the Web Author we would like the displayed breadcrumb for certain elements to show specific data from the document regarding that element.
Say we're editing a document that looks like the following, and the cursor is within `content`.
At present, the breadcrumb reads "section>subsection>content".
From some documentation I saw, you can change this rendering using cc_config.xml, and although it supports `${i18n(key)}` I'd really need it to use `${xpath_eval(expression)}`.
In this instance I'd want the breadcrumb to read "section 1>subsection a)>content", I assumed it would be as simple as.
But no dice, it displays literally "section ${xpath_eval(@num)}>subsection ${xpath_eval(./num/text())}>content".
I've tried without the "section/subsection"-prefix (in case there was some concatenation syntax), and with various xpaths (in case I'm not writing them correctly, like `text()` not being a thing).
The config itself is functional, given the breadcrumb text is changing, but only to literals.
In fact none of the other editor variables seem to operate dynamically, only the localisation one (which was mentioned in the docs) is able to evaluate.
So I'm guessing this is a limitation, and dynamic breadcrumbs aren't done via `cc_config.xml`, if that's so, where can I achieve what we need?
I don't know if this is a 'Common Problem', so let me know if it should be moved somewhere else.
In the Web Author we would like the displayed breadcrumb for certain elements to show specific data from the document regarding that element.
Say we're editing a document that looks like the following, and the cursor is within `content`.
Code: Select all
<section num="1">
<subsection>
<num>a)</num>
<content>blah blah|</content>
</subsection>
</section>
From some documentation I saw, you can change this rendering using cc_config.xml, and although it supports `${i18n(key)}` I'd really need it to use `${xpath_eval(expression)}`.
In this instance I'd want the breadcrumb to read "section 1>subsection a)>content", I assumed it would be as simple as.
Code: Select all
<render element="section" as="section ${xpath_eval(@num)}" />
<render element="subsection" as="subsection ${xpath_eval(./num/text())}" />
I've tried without the "section/subsection"-prefix (in case there was some concatenation syntax), and with various xpaths (in case I'm not writing them correctly, like `text()` not being a thing).
The config itself is functional, given the breadcrumb text is changing, but only to literals.
In fact none of the other editor variables seem to operate dynamically, only the localisation one (which was mentioned in the docs) is able to evaluate.
So I'm guessing this is a limitation, and dynamic breadcrumbs aren't done via `cc_config.xml`, if that's so, where can I achieve what we need?