Force p-tag in new <li> elements
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 72
- Joined: Tue Oct 21, 2014 10:01 pm
Force p-tag in new <li> elements
I'd like to have the editor automatically add a <p> tag inside the <li> elements of my unordered lists <ol>. Is this possible in Oxygen without manipulating the DTD?
For example,
Currently, adding a new <li> tags omit the <p> tag.
Thanks for the input.
For example,
Code: Select all
<ul>
<li><p/></li>
...
</ul>
Thanks for the input.
-
- Posts: 515
- Joined: Wed May 20, 2009 2:40 pm
Re: Force p-tag in new <li> elements
Hi,
What you can do is to update the action that is used to insert list items, to change the fragment that is inserted in the document (from <li/> to <li><p/></li>).
For example, for DITA document type (this is similar for other built-in frameworks) you have to go to "Options"->"Preferences"->"Document Type" option page, select the DITA document type and press "Edit". All the actions are defined in "Author" tab, "Actions" subtab.
To update the list item action follow these steps:
To do that, go back to document type edit dialog, "Author" tab, "Content Completion" subtab, select the action from the "Available actions" section and add it to the "Current actions" section.
Please let me know if you need further information.
What you can do is to update the action that is used to insert list items, to change the fragment that is inserted in the document (from <li/> to <li><p/></li>).
For example, for DITA document type (this is similar for other built-in frameworks) you have to go to "Options"->"Preferences"->"Document Type" option page, select the DITA document type and press "Edit". All the actions are defined in "Author" tab, "Actions" subtab.
To update the list item action follow these steps:
- Select the list item action from the actions list (it has the "listitem" ID) and press "Edit". The "Action" dialog is opened.
- In the "Operations" section you will see that there are multiple operations defined, each of them being activated in a specific context (see the XPath expresion that must be evaluated to determine when the operation is applied). You have to search for all the operations that are executed in the context of ol or ul and change the corresponding fragment argument from to
Code: Select all
<li/>
.Code: Select all
<li><p/></li>
To do that, go back to document type edit dialog, "Author" tab, "Content Completion" subtab, select the action from the "Available actions" section and add it to the "Current actions" section.
Please let me know if you need further information.
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 515
- Joined: Wed May 20, 2009 2:40 pm
Re: Force p-tag in new <li> elements
Hi,
In the "Author" tab, "Content Completion" subtab there is also a "Filter" section where you can specify the name of the content completion items that you want to be filtered from the "Content Completion Window", "Elements View", "Element Insert Menus"and "Entitties View".
Unfortunately, there is a limitation that I think you will encounter: the "New li" entry from the content completion cannot be filtered individually.
The "New li" item appears when you want to split the li element at caret. So, it is a split operation that can be filtered by specifying "<Split>" as item name in the "Remove item" dialog (that appears when you try to add an entry in the "Filter" section from "Content Completion" tab). If you do that, all the split items will be filtered from the content completion (e.g. "New p").
We plan to remove that limitation and also to implement an easier way to specify the content to be added when an element is inserted in the document.
We will let you know when these improvements will be available.
In the "Author" tab, "Content Completion" subtab there is also a "Filter" section where you can specify the name of the content completion items that you want to be filtered from the "Content Completion Window", "Elements View", "Element Insert Menus"and "Entitties View".
Unfortunately, there is a limitation that I think you will encounter: the "New li" entry from the content completion cannot be filtered individually.
The "New li" item appears when you want to split the li element at caret. So, it is a split operation that can be filtered by specifying "<Split>" as item name in the "Remove item" dialog (that appears when you try to add an entry in the "Filter" section from "Content Completion" tab). If you do that, all the split items will be filtered from the content completion (e.g. "New p").
We plan to remove that limitation and also to implement an easier way to specify the content to be added when an element is inserted in the document.
We will let you know when these improvements will be available.
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Force p-tag in new <li> elements
Hi,
To bring completion to this older forum thread, in Oxygen 18.0 there is a content completion configuration XML document which can be used to state that certain elements should have required child sub elements or attributes:
https://www.oxygenxml.com/doc/versions/ ... ually.html
Regards,
Radu
To bring completion to this older forum thread, in Oxygen 18.0 there is a content completion configuration XML document which can be used to state that certain elements should have required child sub elements or attributes:
https://www.oxygenxml.com/doc/versions/ ... ually.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service