cancel
Showing results for 
Search instead for 
Did you mean: 

Customize existing smartedit toolbar

Former Member
0 Kudos

Hi all,

I am trying to add additional buttons to the existing smartedit toolbars. I have generated a new extension from ysmarteditmodule, read through the generated sample files and compared those with the files in the existing cmssmartedit extension.

Without seeing smartedit, I would have thought that the sample files would add some analyze button to the existing toolbars. However, that button comes up in the toolbar of the analysis perspective it creates instead. It's adding the button to the toolbar with ID "experienceSelectorToolbar" and I cannot spot anything that would point to a certain perspective anywhere. In short, I have no clue what makes that button show up in the toolbar of the sample analysis perspective rather than the toolbar of eg. the advanced edit perspective. Not the toolbar ID it seems.

Is there even a way to add a button to the existing toolbar defined in eg. cmsmartedit, ie. a toolbar defined in a different extension? Or does it automatically scope everything to the current extension?

Thanks in advance for any help!

Cheers, Sven

Accepted Solutions (1)

Accepted Solutions (1)

chhunry_pheng
Explorer

There should be a configuration for perspectiveService.register() to register features to a perspective.

To add a feature to the existing basic edit perspective, you need something like this:

 // The key must match one of the existing perspective keys defined in cmssmartedit. 
 perspectiveService.register({
         key: 'se.cms.perspective.basic',
         nameI18nKey: 'se.cms.perspective.basic.name',
         features: ['sampleToolbarButton']
 });

See the follow docs for more information:

Former Member
0 Kudos

Thank you very much and sorry for the late response.

Unfortunately it does not change anything. The button shows for the analysis perspective, but it will not show up in edit perspective.

chhunry_pheng
Explorer
0 Kudos

Actually, the previous configuration was missing the nameI18nKey property and SmartEdit threw a validation error. The code sample above was updated to reflect this.

Former Member
0 Kudos

Thanks a lot for your patience and help! I finally got the button show up after fixing some other issues that I had not realized exist in my setup.

Answers (0)