@Petr i have been trying to duplicate what you have done, using same files and filenames etc but I dont seem to get "Image Width Editor" in the Macro Parameter / Type dropdown?
Does it need registred or something? Any advice greatfully received :)
I am having a similar problem to Paul - I have replicated the code that Petr supplied, but I cannot see the ImageWidthEditor parameter in my list of macro parameters.
I have added the isParameterEditor: true to the package.manifest, reset IIS and cleared my cache but to no avail.
Custom dropdown macro parameter editor
I am trying to build a custom dropdown macro parameter editor, but it does not show up at macro properties tab.
I have two files. First App_Plugins/ImageWidthEditor/ImageWidthEditor.html containing
<div> <select class="umb-editor umb-dropdown"> <option value="20">20 %</option> <option value="30">30 %</option> <option value="40">40 %</option> <option value="50">50 %</option> <option value="100" selected>100 %</option> </select> </div>and App_Plugins/ImageWidthEditor/package.manifest containing
{ parameterEditors: [ { alias: "ImageWidthEditor", name: "Image Width Editor", editor: { view: "~/App_Plugins/ImageWidthEditor/ImageWidthEditor.html" } } ] }It still does not work, but I must be very close. Now I have three files:
App_Plugins/ImageWidthEditor/ImageWidthEditor.controller.js
angular.module("umbraco") .controller("My.ImageWidthEditorController", function () { });App_Plugins/ImageWidthEditor/ImageWidthEditor.html
<div ng-controller="My.ImageWidthEditorController"> <select ng-model="model.value" class="umb-editor umb-dropdown"> <option value="20">20 %</option> <option value="30">30 %</option> <option value="40">40 %</option> <option value="50">50 %</option> <option value="100" selected>100 %</option> </select> </div>{ parameterEditors: [ { alias: "My.ImageWidthEditor", name: "Image Width Editor", editor: { view: "~/App_Plugins/ImageWidthEditor/ImageWidthEditor.html" } } ], javascript: [ "~/App_Plugins/ImageWidthEditor/ImageWidthEditor.controller.js" ] }In the package.manifest put isParameterEditor: true
Hello Arunabha!
Well, I am 120 percent sure that I tried that before but with no luck. After your suggestion I tried that again and now it works perfect, strange :)
Anyways, thank you very much!
Hi all,
For me just changing in package manifest doesn't work. I was creating a propertyeditor from c# and my code looks like in below:
[PropertyEditor("mycontentpicker", "mycontentpicker", "/App_Plugins/mycontent/mycontentpicker.html", ValueType = "STRING", IsParameterEditor=true)] [PropertyEditorAsset(ClientDependencyType.Javascript, "/App_Plugins/mycontent/mycontentpicker.js")] public class MyContentPropertyEditor : PropertyEditor { }Before
was not there but was in package.manifest and doesnt' work. After changing the IsParameterEditor value into true in my class file it works.
Thanks
PTamang
Hi Pasang,
I already mentioned on my post, that In the package.manifest put isParameterEditor: true :)
@Petr i have been trying to duplicate what you have done, using same files and filenames etc but I dont seem to get "Image Width Editor" in the Macro Parameter / Type dropdown?
Does it need registred or something? Any advice greatfully received :)
Paul
Hi Paul,
Reset the iis and clear all browser cache Reload it. it will work.
Hi... when i try to fetch the value from the dropdown, i always get NULL.
What can be the case... my pluging is exactly the same
I created a macro with Alias 'size' and Type the type above 'Image Size'.
Any help on why i get the NULL value when fetching it..
Hi Vishal,
Did you create the 'size' parameter on the macro itself in the Umbraco backend?
I am having a similar problem to Paul - I have replicated the code that Petr supplied, but I cannot see the ImageWidthEditor parameter in my list of macro parameters.
I have added the
isParameterEditor: trueto thepackage.manifest, reset IIS and cleared my cache but to no avail.Does anyone have any ideas?
Comment author was deleted
this has worked for me.
is there a documentation where these properties is listed out? I am a bit frustrated i have to keep searching in google.
Hi, bit late to the party but I have created a really simple custom dropdown plugin that you can download from github and read how to implement a custom umbraco dropdown parameter here
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.