Creating a new property editor (v13) - Question re...
# help-with-umbraco
c
Hey All, Just a quick query regarding the docs of: https://docs.umbraco.com/umbraco-cms/v/13.latest-lts/tutorials/creating-a-property-editor#setting-up-a-property-editor-with-csharp First time setting up a property editor so apologies if its a nooby question! The docs state to create the initial definition at the root of the project. Is that in terms of the Namespace? Or literal file location? For example, I'm wanting to store my backoffice editors in a folder structure of
Copy code
/MyProject/Backoffice/[EditorName]/
Purely for aesthetic reasons Cheers!
b
Hi, i think what the documentation tries to get through, is that the convention is to put the frontend portion of your code (JS/HTML/asset etc.) under a
\App_Plugins\MyPlugin
. If you use a package.manifest file to register your plugin, Umbraco looks in that folder for those files, so having the rest of the files there makes sense. I assume if you would want to deviate from the convention, you could do the registration through C#, and you would be free to place them anywhere accessible. This is not something I've tried before though, and just looking at community packages, its not exactly I've seen, maybe for a reason. 🙂 If you have the time to experiment, maybe worth the try, and post the results.
c
Cheers for the explanation! I've certainly gone ahead and placed all of the front end required files under the app plugins directory. It was more for the "registering" the package through C# as opposed to a Package manifest file that my query concerned. It does seem like there's some tie in with the namespace itself being the route to that registration so placing it under a namespace of:
Copy code
MyWebsite
Works, however placing the registration under for example:
Copy code
MyWebsite.Backoffice.PropertyEditors
Does not. Bit of a shame, may end up also just following the convention of a package manifest as well, - Just liked the idea of registering them through C# in their own subset of the namespace so I could use configuration DI to add flags of turning the features on or off at the registration level. Certainly not a huge issue as its more of an OCD "Id like my custom stuff to not live at the root Namespace" but It is what it is!
Just to "Close up" the topic, very happy that the functionality of the custom property is now done! Pulling the title of selected filters from a parent node and listing the values from within those filters onto the individual item itself! Now to make it look "Umbraco-ey" https://cdn.discordapp.com/attachments/1288406844192325654/1288825365564887062/image.png?ex=66f697a8&is=66f54628&hm=d4ab375ce7cb635ede33fd227989fc57a6da10011138018fd407b2f569adf9da&
18 Views