Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm trying to create a custom property editor to be used inside of a macro.
I would like the custom property editor to simply be a copy of the mutli media picker, but with a set start media folder. As I understand it, the only way to get a start folder is to create a custom editor with default start node value since the macro properties cant have pre-vaules.
But after lots of reading and testing I'm still not able to get the property editor to work.
According to this post I could copy the mediaPickerController function from the umbraco.controller.js from the Umbraco source and add the code to my controller.js.
Then copy the html from mediapicker.html from the Umbraco source and paste to my controller.html.
Then in my custom controller set "defaultConfig" to wanted start media folder.
But I'm not able to render the media picker in the macro. Any help would be much appreciated.
/ Best regards
Have a look at this package:
It will generate the package.manifest file 'for you' from your chosen property editor, with your default config.
Restart your Umbraco site, and you should have your new Macro Parameter!
Yupp, yupp. I was aware of this package. But I kind of hesitate when it comes to using packages... :/
Do you know if there are any issues with this package when running on Umbraco 7.11? One of the reasons why I like to keep packages as minimal as possible is the somewhat absent support documentation regarding the packages.
According to the package download page the support on 7.6 and 7.7 is awsome, the rest... who knows... :)
Thanks for the help Marc! /David
Yes you don't need to keep the package installed forever in your build. In fact you could install it in a seperate Umbraco site, and generate the package.manifest file for the configuration you need.
What is important is the package.manifest file it would generate for your scenario is saved into the app_plugins folder of your site.
When Umbarco starts up, it scans the app_plugins folder for package.manifest files, and adds them as options in the backoffice.
All you need to do is 'handcraft' the package.manifest file, to pass in the defaultconfig options to the core property editor.
You don't need to write a custom property editor.
The cool thing about the tool is it will generate the manifest file for you.
But you don't have to keep the package installed to make it work!
So you could install the package on a totally different Umbraco site, use it to generate the package manifest, and copy the file to your actual site.
If that make sense.
Hi again Marc,
I tried the package but it's not quite working. I downloaded the package with nuget and created a custom editor like the docs said. I can choose the newly created editor in my macro but when trying the macro out in the rte the macro dialog is empty and has no property in it.
I made a package of the repeatable textstring property editor with the minimum amount of 1 field but nothing shows up in the macro dialog.
Hi David. The package doesn't always work for all data types unfortunately. You will need to manually modify the package.manifest file.
If for example you want to use a dropdown in a macro, it won't work by default using the Parameter Editor Generator package. The reason is because the default config is not populated correctly. You will have to make some changes to the file manifest file to provide the correct defaultConfig.
E.g. the standard dropdown property editor requires a Dictionary of Items like this:
For the multi media picker you would have to check the media picker property editor template to see what object is is expecting.
Hope this helps.
I just tried this package in 7.13.2, and it doesn't even show the Generate option on datatypes (tried multiple, including custom-made datatypes).
I just want to be able to place a label on the macro properties panel. A simple helptext for the user. :(
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted