Using CSS to provide placeholder-text writer guidance in the Oxygen editor
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Using CSS to provide placeholder-text writer guidance in the Oxygen editor
Post by chrispitude »
Hi everyone,
Our DITA grammar has a <procedure> element (specialized from <ol>) that contains <step> elements (specialized from <li>). I wanted to provide guidance to our writers that each <step> should (1) instruct the reader, (2) optionally describe the result, and (3) optionally explain what happened.
In the Oxygen editor, elements show placeholder text (their name) when empty:
I was not sure if this placeholder text was configurable in some particular way, but I was able to write CSS to emulate it:
With the CSS rule above, the highlighted text is shown in the editor when the first element in a <step> is a <p> and it is empty:
and the placeholder text disappears once the writer starts typing.
In our cc_config_ext.xml file, we have the following entries:
so that when a writer inserts a <procedure> element, the whole initial structure is created for them, along with a reminder of what to write.
I hope someone else finds this CSS placeholder-text method useful!
Our DITA grammar has a <procedure> element (specialized from <ol>) that contains <step> elements (specialized from <li>). I wanted to provide guidance to our writers that each <step> should (1) instruct the reader, (2) optionally describe the result, and (3) optionally explain what happened.
In the Oxygen editor, elements show placeholder text (their name) when empty:
image.png
I was not sure if this placeholder text was configurable in some particular way, but I was able to write CSS to emulate it:
Code: Select all
.snps-d\/step > .topic\/p:first-child:empty:after(1) {
content: 'instruct [result] [explain]';
background-color: #edeff1;
color: #777879;
font-weight: bold;
}
image.png
and the placeholder text disappears once the writer starts typing.
In our cc_config_ext.xml file, we have the following entries:
Code: Select all
<elementProposals path="procedure" insertElements="step"/>
<elementProposals path="step" insertElements="p"/>
I hope someone else finds this CSS placeholder-text method useful!
You do not have the required permissions to view the files attached to this post.
-
- Posts: 9428
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Using CSS to provide placeholder-text writer guidance in the Oxygen editor
Hi Chris,
We also have a special CSS property for configuring the placeholder text:
https://www.oxygenxml.com/doc/versions/ ... nsion.html
Regards,
Radu
We also have a special CSS property for configuring the placeholder text:
https://www.oxygenxml.com/doc/versions/ ... nsion.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Using CSS to provide placeholder-text writer guidance in the Oxygen editor
Post by chrispitude »
Thanks Radu, that simplifies it quite a bit:
Somehow I looked through the CSS files inside the Oxygen installation directory to try to figure this out, but I failed to simply read the documentation.
Code: Select all
.snps-d\/step > .topic\/p:first-child {
-oxy-placeholder-content: 'instruct [result] [explain]';
}
Return to “DITA (Editing and Publishing DITA Content)”
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