Page 1 of 1

Re: Customize Content Completion

Posted: Fri Feb 20, 2015 5:34 pm
by Denis
Hi,

we are using the Eclipse Oxygen Author in Version 15.2.

What would be the best approach, if I want to extend the content completion. The use case:
I want to create this structure:

Code: Select all

<h1> <p></p></h1>
So everytime, if the author choose a <h1> element, the content completion has to add a <p>-element. The problem is the <p>-elemnt is not required. Also I do not want to make it optional.

Best regards
Denis

Re: Customize Content Completion

Posted: Mon Feb 23, 2015 10:45 am
by alex_jitianu
Hello Denis,

The easiest way would be to replace the default entries with author actions. If we were to take your sample as a starting point:
1. you must create an author action. THe action must use the operation ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation and the fragment to insert must be <h1> <p></p></h1>.
2. On the Content Completion page you must add the previously created action in the content completion (select the action in the Available Actions and put it in the Current Actions)
3. In the same Content completion page, remove the default action that adds a h1 element (the one that comes from the schema). To do that you must add an entry in the table Filter - Remove content completion items.
Best regards,
Alex