And that works brilliantly on Umbraco 7, but if I use that same package manifest on my Umbraco 8 project (with the GUIDs changed accordingly) it almost works, the only part that doesn't is the start node...
During my digging, I did notice that the DataType config structures are different in Umbraco 8 compared to 7.
This is how my custom content picker data type's config looks in
Umbraco 8:
After spending 2 hours on Umbraco (8.3) source code, I finally managed to create custom Macro Parameter Editor based on Content Picker and restrict selection to specific node's children.
Here is the C# code, if anyone interested:
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
using System.Configuration;
namespace Umbraco.Web.PropertyEditors
{
/// <summary>
/// Content property editor that stores UDI
/// </summary>
[DataEditor(
"Umbraco.ContentPickerEx",
EditorType.MacroParameter,
"Content Picker Ex",
"contentpicker")]
public class ContentPickerExParameterEditor: DataEditor
{
public ContentPickerExParameterEditor(ILogger logger)
: base(logger)
{
var startNodeId = ConfigurationManager.AppSettings["MacroParamEditors.InfoCardStartNodeId"];
DefaultConfiguration.Add("startNodeId", startNodeId);
}
}
}
Just for records, I added C# file in VS.NET project with code I pasted above and added app settings in web.config. Build, deploy and I can see my new Macro parameter editor.
I added a "prevalues" to my manifest that defined the start node and it started working! (also I changed the defaultConfig options to use bools instead of 1s & 0s).
EDIT: I also changed the StartNodeId to an ID instead of a UDI.
I also added a .js and a .html file to my plugin and copied the Content Picker js controller and html view from the umbraco source code and then changed the manifest to reference them instead, as suggested here link!
Macro custom Content Picker with Start Node
Hello,
I'm trying to add a custom content picker (with a start node) to a macro's parameter editor on Umbraco 8.
I can successfully do this on Umbraco 7 by generating a package manifest, from a custom DataType, with this plugin: Parameter Editor Generator
Which generates this file:
And that works brilliantly on Umbraco 7, but if I use that same package manifest on my Umbraco 8 project (with the GUIDs changed accordingly) it almost works, the only part that doesn't is the start node...
During my digging, I did notice that the DataType config structures are different in Umbraco 8 compared to 7.
This is how my custom content picker data type's config looks in Umbraco 8:
and Umbraco 7:
This gif shows it working in Umbraco 7:
And it not working in Umbraco 8:
Has anyone else tried this before? And does anyone know how to properly format the Property Editor package manifest for Umbraco 8?
Hi,
I am also facing the same issue with Umbraco 8.3. Does anyone knows how to fix package manifest file for version 8.3?
Thanks.
After spending 2 hours on Umbraco (8.3) source code, I finally managed to create custom Macro Parameter Editor based on Content Picker and restrict selection to specific node's children.
Here is the C# code, if anyone interested:
Hope it helps.
Thanks.
Hi Javed,
Glad you've found a solution! :D
Where did you put that C# code in your solution? And did you need to do anything different with the package manifest file?
Cheers
Hi Owain,
Glad you fixed manifest file.
Just for records, I added C# file in VS.NET project with code I pasted above and added app settings in web.config. Build, deploy and I can see my new Macro parameter editor.
Thanks.
I've fixed it!
I added a "prevalues" to my manifest that defined the start node and it started working! (also I changed the defaultConfig options to use bools instead of 1s & 0s).
EDIT: I also changed the StartNodeId to an ID instead of a UDI.
I also added a .js and a .html file to my plugin and copied the Content Picker js controller and html view from the umbraco source code and then changed the manifest to reference them instead, as suggested here link!
As you can see with this gif, it now works as expected :D (Umbraco 8.3)
These links helped me with this: https://our.umbraco.com/documentation/Tutorials/Creating-a-Property-Editor/part-2
https://our.umbraco.com/forum/developers/extending-umbraco/63642-How-to-use-MultiNodeTreePicker-as-a-Macro-parameter-editor
is working on a reply...