Page 1 of 1

Adding placeholder content

Posted: Fri Dec 15, 2017 10:55 pm
by JulieP
I have two questions:

Is there a way to add placeholder text in Author view? So far, I've only been able to add it in Text view using the "<?oxy-placeholder content="XYZ"?> format.

Can we add placeholders for text in the middle of a sentence? For example, consider a standard phrase like "Getting started with <application=name" where the writer must provide the actual name. Can the <application-name> text be configured as a placeholder?

Re: Adding placeholder content

Posted: Mon Dec 18, 2017 12:53 pm
by alex_jitianu
Hello,
Is there a way to add placeholder text in Author view? So far, I've only been able to add it in Text view using the "<?oxy-placeholder content="XYZ"?> format.
When building the template you can insert placeholders for the existing elements through oxy-placeholder processing instructions. Another way to add placeholders is through CSS.

Do you want these placeholders to be inserted on user interaction? For example, when he is invoking an action on the toolbar? If that's the case then there are some possibilities:
1. you can configure the action and put oxy-placeholder PIs in its empty elements.
2. you can configure the action and put $ask editor variables (please note that the user will be presented with a dialog in which he has to give the value).
3. If the placeholders are added from the CSS then empty elements will automatically present the labels (assuming that the CSS selectors match those empty elements)
Can we add placeholders for text in the middle of a sentence? For example, consider a standard phrase like "Getting started with <application=name" where the writer must provide the actual name. Can the <application-name> text be configured as a placeholder?
They can, but there are some aspects to consider. Placeholders are presented only when an element is empty. This means that you must insert an anchor element inside that phrase:

Code: Select all

Getting started with <ph><?oxy-placeholder content="Application name"?></ph> 
If this phrase comes from an action then this action can either insert a fragment like the one above or can opt to use the ${ask} to get the variable content (and there is no need for an anchor element).

Please let me know if you had something different in mind or if my answers clarify things.

Best regards,
Alex