Developer forum

Forum » CMS - Standard features » How to enable Focal Point Selector in code first items

How to enable Focal Point Selector in code first items

Heine Virenfeldt Kristensen
Heine Virenfeldt Kristensen
Reply

Hi, Working with code first items, but can't seem to find a solution for enabling the focal point selector. Any tips?
 

Using DW 9.7.6

 

 

Capture.PNG Capture2.PNG

Replies

 
Vladimir Shushunov Dynamicweb Employee
Vladimir Shushunov
Reply

Hi Heine,

You could define the new attribute in your code:

    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
    public class MyFileEditorAttribute : FileAttribute
    {
        public bool UseFocalSelector { get; set; }

        protected override void InitializeEditorConfiguration(ItemField itemField)
        {
            var fileEditor = new FileEditor
            {
                BaseDirectory = BaseDirectory,
                Extensions = Extentions,
                AllowFrontendUpload = AllowFrontendUpload,
                MaxFilesToAdd = MaxFilesToAdd,
                ShowAsImageSelector = ShowAsImageSelector,
                UseFocalSelector = UseFocalSelector
            };

            itemField.EditorConfiguration = fileEditor.GetParametersToXml(false);
        }
    }

We will add this code as part of default functionality in next releases.

Best regards, Vladimir

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Heine

The above code was added to Dynamicweb version 9.8.4

This is ready in the download section:

https://doc.dynamicweb.com/downloads/releases

Kind Regards
Dynamicweb Support
Kristian Kirkholt

 

You must be logged in to post in the forum