Dolbery
Dolbery

Reputation: 185

CQ5 Dialog.xml - how to insert a paragraph?

Most of the text in my dialog.xml is labels for form inputs.

Is there a way to have just a plain paragraph that offers the user some explanation?

Upvotes: 1

Views: 1140

Answers (2)

Thomas
Thomas

Reputation: 7066

You can use the label xtype:

<mylabel
    jcr:primaryType="cq:Widget"
    fieldLabel="My label"
    html="Some description text in &lt;b&gt;bold&lt;/b&gt;"
    xtype="label"/>

As you can see, you can even use simple tags within the html property like <b> and <i>. Of course the brackets escaped as &lt; and &gt;

Upvotes: 5

nateyolles
nateyolles

Reputation: 1921

You can use a displayfield xtype. Read the docs for the CQ5 Widget API CQ.Ext.form.DisplayField. Here is an example:

<instructions
    jcr:primaryType="cq:Widget"
    fieldLabel="Instructions"
    fieldDescription="Insert instructions for your authors here."
    xtype="displayfield" />

You can use long paragraphs and you can insert HTML by using character entities. For example:

This will bold &lt;strong&gt;this text&lt;/strong&gt;.

Upvotes: 3

Related Questions