using oxy_htmlcontent with pseudo-elements and -oxy-placeholder-content with the main element

Post here questions and problems related to oXygen frameworks/document types.
jeff_hooker
Posts: 22
Joined: Tue Jun 11, 2019 9:01 pm

using oxy_htmlcontent with pseudo-elements and -oxy-placeholder-content with the main element

Post by jeff_hooker »

Hi folks,
I've defined an element-by-element external help system for an internal schema and defined a custom style within Oxygen. I've linked to the external help system like this:

Code: Select all

dimension > namePattern:before(201) {
    display: inline;
    font-family: arial, helvetica, sans-serif;
    line-height: 1rem;
    margin-top: 0.4em;
    margin-bottom: 0.2em;
    content: oxy_htmlContent(href, 'register-hints.html', id, oxy_concat('register-hints', '-', oxy_local-name()));
  }
I would like the name of an empty element to appear as the element's default content, so I define it like this:

Code: Select all

 dimension > namePattern{
  -oxy-placeholder-content: oxy_name();
  }
However, when I have any content defined using the :before pseudo-element, the -oxy-placeholder-content is never visible. Is there a way of doing both of these things at once?
Radu
Posts: 9632
Joined: Fri Jul 09, 2004 5:18 pm

Re: using oxy_htmlcontent with pseudo-elements and -oxy-placeholder-content with the main element

Post by Radu »

Hi,
The docs says something like this:
https://www.oxygenxml.com/doc/versions/ ... nsion.html
Oxygen XML Editor displays the element name as pseudo-content for empty elements ... and there is no before or after content set in the CSS for this type of element.
So once you define a before or after the placeholder text is no longer displayed. You can kind of do something similar by using the ":empty" selector on the element with some static "content:" value placed.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply