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

How to include richtext in a custom xtype as multifield

Avatar

Avatar
Validate 1
Level 1
Naren1224
Level 1

Likes

0 likes

Total Posts

14 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
Naren1224
Level 1

Likes

0 likes

Total Posts

14 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
Naren1224
Level 1

15-10-2015

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.

View Entire Topic

Avatar

Avatar
Validate 1
Level 1
Naren1224
Level 1

Likes

0 likes

Total Posts

14 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
Naren1224
Level 1

Likes

0 likes

Total Posts

14 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
Naren1224
Level 1

15-10-2015

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