コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

この会話は、活動がないためロックされています。新しい投稿を作成してください。

解決済み

How to include richtext in a custom xtype as multifield

Avatar

Level 2

Hi,

I have a requirement of adding a richtext in a custom multifield.

There is a richtext component created under '/apps/website/components/richtext/items/items/richtext'

This richtext would have 3 plugins as well.

 

Now my custom multifield xtype should have the below

1) Text Field

2) Pathfield

3) Richtext(with the additional plugins. Same as /apps/website/components/richtext/items/items/richtext).

 

I tried the below option

1)

this.text = new CQ.form.RichText({

                anchor: '100%',

                fieldLabel : "Enter Text",

                width : '400',

                "rtePlugins" :{

                    "edit" : {

                        "features" : ['cut', 'copy', 'paste-plaintext']

                    },

                    "subsuperscript" : {

                        "features" : "*"

                    },

                    "spellcheck" : {

                        "features" : "*"

                    },

                    "undo" : {

                        "features" : "*"

                    },

                    "findreplace" : {

                        "features" : "*"

                    },

                    "misctools" : {

                        "features" : "*"

                    }

                },

                listeners : {

                    change :{

                        scope : this,

                        fn : this.updateHidden

                    },

                    dialogclose: {

                        scope : this,

                        fn : this.updateHidden

                    },

                    destroy: function(){

                        this.el.dom={};

                    }

                }

            });

            this.add(this.text);

 

However in the dialog I'm able to add the xtype only once.

On click of add item I see the below error in console

 

TypeError: features is undefined
var featCnt = features.length;

Please let me know how I can get rid of this error.

2) Is there an option to include xtype as cqinclude

  path : '/apps/website/components/richtext/items/items/richtext.infinity.json',

  xtype : 'cqinclude',  

 

Thanks

Narendra.

1 受け入れられたソリューション

Avatar

正解者
Level 10

there are some changes compare to 5.5 in 5.6.1 w.r.t rte that might be causing to break. Sorry I do not have sample to share. 

元の投稿で解決策を見る

5 返信

Avatar

以前のコミュニティメンバー

Check and see if this works for you http://aemfaq.blogspot.co.nz/2013/04/richtext-in-multifield-widget.html.

As far as i know it is not recommended to have a richtext within a multifield as you can run into several issue. Do test on all the browsers thoroughly before you roll out anything.

Avatar

Level 10

Avatar

Level 2

Hi Sham,

Thanks for your response.

I tried comparing the hooks.js in my local instance with the one in the package downloaded from the link provided. I didnt find any difference.

However, I have a requirement to add some plugins in my richtext, as per the js provided above.

While doing so, I got the below error.

TypeError: features is undefined
var featCnt = features.length;

The same code while trying in CQ5.5 doesnt show any error. Is there something which should is cusing this error in CQ5.6.1 alone.

Please assist.

 

Thanks

Naren

Avatar

正解者
Level 10

there are some changes compare to 5.5 in 5.6.1 w.r.t rte that might be causing to break. Sorry I do not have sample to share. 

Avatar

Level 10

Here is a community article that we have. However - the RichText Editor in this community article is defined at the JCR level - not in JS script:

http://helpx.adobe.com/experience-manager/using/creating-aem-multifield-components.html