Skip to content

A simple yet very flexible PCF control to display text with custom style using HTML tags or CSS styles on a Unified Interface Form in Model Driven Apps on Common Data Service (CDS) / Dynamics 365 / Power Platforms. The control could also be used for displaying lengthy text such as questions / instructions / information that cannot be displayed u…

License

Notifications You must be signed in to change notification settings

Kokulan365/Simple-Text-Control-PCF

Repository files navigation

About Simple Text Control

A simple yet very flexible PCF control to display text with custom style using HTML tags or CSS styles on a Unified Interface Form in Model Driven Apps on Common Data Service (CDS) / Dynamics 365 / Power Platforms. The control could also be used for displaying lengthy text such as questions / instructions / information that cannot be displayed using out of the box label control.

Text could be displayed with custom formats using HTML tags / CSS styles. The control allows customizer to add longer text than out of the box label control or section label. A maximum of about 800 characters in total can be added. The number 800 includes any HTML tags added to the text. PCF configuration page only allows 160 characters. To get around that limit, this control has 5 text input properties (Text Part 1-5), allowing you to add about 800 characters. Text entered in Part 1-5 are all combined into one long string. The text is rendered using a span tag and the span is added to a div container. And the text itself is set using innerHTML property of the span element, making it easy to add html tags with the text to format or set the style.

Examples Screenhot

Downloading and Installing the control

Both managed and unmanaged versions of the solution are released and they can be found on releases page of this repository. Please follow the link below to get to release page.

Release Page

How to use the control

The control currently only binds to a "Single Line of Text" and the control can be added to the form by going into Controls tab of the field property and clicking on Add Control button as shown below.

How To Add

Once you added the control, you can set the text and style as shown in the screenshot below.

How To Use

Sample Text 1 - Output and Configuration

Sample Text 1

The above output was produced by the following configuration

Text Part 1: <span style="font-weight:bold"> Messages could be displayed with <span style="color:red">custom formats.</span></span> to get user's attention,

Text Part 2: The control allows you to add longer text than out of the box label control or section label.

Text Part 3: A maximum of about 800 characters in total can be added. The 800 includes any HTML tags added to the text. PCF configuration page only allows 160 characters.

Text Part 4: However, there are 5 properties - Text Part 1-5, allowing you to add about 800 characters.

Text Part 5:

Text Style: color:black

Div Container Style: background-color:#e6ffe6;

Sample Text 2 - Output and Configuration

Sampe Text 2

The above output was produced by the following configuration

Text Part 1: Please make sure you <strong> talk to the customer </strong> before hand. Please <span style="color:red"> remember </span> to send the documents 2 days

Text Part 2: before the actual call. They can also be asked to send email to <span style="color:blue">customerservice@testcompnay.com </span>

Text Part 3: And if they would like to call us on the phone, please give them <span style="color:black">customer service number 011334444</span>. Calls made with

Text Part 4: full preparation have most of the time ended in great <strong><span style="color:green">success </span> </strong>, so please make sure you prepare well.

Text Part 5: if you would like to remind yourself of the terms and conditions, please go to the following link <a href="https://www.google.co.uk/">Bing </a>

Text Style:

Div Container Style:

About

A simple yet very flexible PCF control to display text with custom style using HTML tags or CSS styles on a Unified Interface Form in Model Driven Apps on Common Data Service (CDS) / Dynamics 365 / Power Platforms. The control could also be used for displaying lengthy text such as questions / instructions / information that cannot be displayed u…

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published