Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

AEM 6.4 - Text Area in Content Fragments

agerrard1
Level 1
Level 1

I am currently working on implementing a content fragment model for a use case where I want authors to be able to make multiples lines of text with a requirement that all text is plain text.

 

When creating the model, I am given the option of "Single Line Text" and "Multi Line Text". The single line text seems to be plain text but the authoring field is only (obviously) a single line, whereas I want to be able to author multiple lines. The Multi Line Text option seems to force the RTE by default, which I definitely do not want since my requirement is plain text.

 

From my prior dialog knowledge, I believe that the "Text Area" component would fit my needs perfectly, however it is not a default option when creating the model. If I force the resource type of the field to be text area in CRX/DE, it actually does seem to work the way I want it to - but are there concerns with this approach? If so, is there any way that I can get my goal of a larger text area with forced plain text (ie: no RTE)? Even a forced default of plain text on the multi line text field would work, but I don't see this as option anywhere.

1 Accepted Solution
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

You can use coral/granite type resources instead of cfm type.

e.g. Field Label 3

fieldLabel=Field Label 3
jcr:primaryType=nt:unstructured
listOrder=21
metaType=text-multi
name=textarea23
renderReadOnly=false
showEmptyInReadOnly=true
sling:resourceType=granite/ui/components/coral/foundation/form/textarea
valueType=string

 

 

 

Arun_Patidar_0-1600720387071.png

 

View solution in original post

1 Reply
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

You can use coral/granite type resources instead of cfm type.

e.g. Field Label 3

fieldLabel=Field Label 3
jcr:primaryType=nt:unstructured
listOrder=21
metaType=text-multi
name=textarea23
renderReadOnly=false
showEmptyInReadOnly=true
sling:resourceType=granite/ui/components/coral/foundation/form/textarea
valueType=string

 

 

 

Arun_Patidar_0-1600720387071.png

 

View solution in original post