Expand my Community achievements bar.

SOLVED

AEM 6.4 - Text Area in Content Fragments

Avatar

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

Avatar

Correct answer by
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

 



Arun Patidar

View solution in original post

1 Reply

Avatar

Correct answer by
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

 



Arun Patidar