Page 1 of 1
Hide elements with content completion
Posted: Thu Oct 30, 2014 2:54 pm
by Joerg
Hi,
Is it possible with the filter in the content completion to hide the <fig> element only within in <p>?
As both of them are block elements we don't want to let an author select the <fig> in a <p>.
Can this be done without an DTD change?
Best Regards
Joerg
Re: Hide elements with content completion
Posted: Thu Oct 30, 2014 3:23 pm
by Radu
Hi Joerg,
This could be done with a document type customization.
If in the Oxygen Preferences->Document Type Association page you edit the DITA document type:
1) In the Author->Content Completion tab you can add the fig element to the list of elements to remove completely.
2) Then in the Author->Actions tab you can define a new action with the name fig which has an activation XPath (which you can set something like not(ancestor-or-self::p)) and calls an operation, you can choose an existing implementation called ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation which inserts a certain XML fragment (for example <fig><title/></fig>).
3) Go back to the Author->Content Completion tab and add your new action to the list of content completion window entries.
Regards,
Radu
Re: Hide elements with content completion
Posted: Thu Oct 30, 2014 7:28 pm
by Joerg
Thanks a lot Radu,
This is a good procedure.
Best Regards,
Joerg