1

I want to give a custom image field's property dialog a class dropdown. Currently I have a custom image field which points to a custom image control.

That control overrides Sitecore.Shell.Applications.ContentEditor.Image's ShowProperties method. The only line that I have really changed in that method is the line that has a namespace reference.

I have overriden it to point to a custom class that inherits from Sitecore.Shell.Applications.Media.ImageProperties.ImagePropertiesPage.

I'm getting the following error indicating that my class cannot be found:

Xaml control "MyNamespace.CustomSitecore.Shell.Applications.Media.BrandedImageProperties.BrandedImagePropertiesPage, MyNamespace.Common" not found. The last error was: [No error]

The line I have changed is as follows:

    UrlString urlString = new UrlString(FileUtil.MakePath("/sitecore/shell", 
        ControlManager.GetControlUrl(
            new ControlName(
                "MyNamespace.CustomSitecore.Shell.Applications.Media.BrandedImageProperties.BrandedImagePropertiesPage"))
        )
    );

I'm assuming that's because it looks in Sitecore.Client. Is there any way to change this so it will look through a dll I specify? Is this even the right way to do something like this (override 1 dialog on a field by creating a completely new field)?

  • where is the control you created found? Because the above code, it will search for the control within the sitecore/shell folder. If you place your control within the sitecore/shell/application/[custom folder], the above code may work – Hishaam Namooya Jul 24 '17 at 20:37
2

You need to make sure that you have created your control and is present in the website/sitecore/shell or website/sitecore modules/.

Moreover, the namespace used in the code should match the one in the control, i.e, the xaml/xml file.

| improve this answer | |
  • Yup I had copied the default xml file and didn't change the xml node inside it to match what was being looked up (screencast.com/t/YUkBgDp3f). Once I made that change it looked it up correctly. I do wish I could just make a command to open the dialog so I don't need to go through the hoops of overriding as much stuff as I did though. – Teeknow Jul 24 '17 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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