I am using Sitecore 8.2 (initial release) and I have a case when for a rendering I have defined the fields

'Datasource Template'

and

'Datasource Location'

but I need to disable the button for

'Create new content'

that appears in the window displayed in editor when adding a component.

enter image description here

I can see that if no 'Datasource Template' is defined on the rendering the button is disabled by default, so this seems doable.

enter image description here

Is there an easy way to somehow disable it even if I have defined the template for the rendering?

share|improve this question

You need to change: \Website\sitecore\shell\Applications\Dialogs\SelectRenderingDatasource\SelectRenderingDatasource.xml

He use Sitecore.Shell.Applications.Dialogs.SelectRenderingDatasource class.

You need to override method

 protected override void OnLoad(EventArgs e)

You need to have something like

 if (yourconditionaretrue)
  {
      this.DisableCreateOption();
  }
share|improve this answer

You can remove Create access right from certain group of users. This won't disable the button but nobody from this group will be able to create anything there.

Sitecore will display a message and disable the OK button as on the picture below.

Message which will be shown to the users

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.