I was putting the name of my assembly into the macroPropertyTypeRenderAssembly, it should be the namespace apparently! Then in macroPropertyTypeRenderType is should be the type name (without any assembly name or namespace).
I think your solution didn't work for me because of the way I had set up my assembly in the first place.
Umbraco 6 Custom Macro Param Type Broken
using System; using System.Collections.Generic; using System.Text; using System.Web.UI.WebControls; using umbraco.interfaces; public class NewsletterPicker : DropDownList, IMacroGuiRendering { public bool ShowCaption { get { return true; } } public string Value { get { return this.SelectedValue; } set { this.SelectedValue = value; } } protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (this.Items.Count != 0) return; this.Items.Add(new ListItem("Men's Health", "G0071")); this.Items.Add(new ListItem("Women's Health", "G0072")); this.Items.Add(new ListItem("Heart Care", "G0073")); this.Items.Add(new ListItem("Breast Health", "G0074")); this.Items.Add(new ListItem("Diabetes Health", "G0075")); this.Items.Add(new ListItem("For Your Child", "G0076")); this.Items.Add(new ListItem("Mind and Body", "G0077")); } }Updated the macro parameter types database with my assembly name and class name, but still no luck.
Got it figured out... had to do with the way my namespaces were setup.
Hi Robert,
I'm having a similar issue.
Can you tell me what your solution was?
Thanks,
Robert
Yes, it has to do with the way you register the control in the database. Here's my control code:
namespace LourdesWeb.macroParams { public class NewsletterPicker : DropDownList, IMacroGuiRendering { protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (this.Items.Count == 0) { .... } } #region IMacroGuiRendering Members public bool ShowCaption { get { return true; } } public string Value { get { return this.SelectedValue; } set { this.SelectedValue = value; } } #endregion } }And in the Umbraco cmsMacroPropertyType table:
idmacroPropertyTypeAliasmacroPropertyTypeRenderAssemblymacroPropertyTypeRenderTypemacroPropertyTypeBaseType
26newsletterPickerLourdesWebmacroParams.NewsletterPickerString
So, the thing is, you only put the last part of your namespace for some reason for the macroPropertyTypeRenderType field. Weird, but true. ;-)
Oppps, that data didn't render well...
Thanks for this Robert.
I think I have everything set up in the same way but I still can't get the property to work.
Very frustrating!
Robert
Ah, Finally solved it!
I was putting the name of my assembly into the macroPropertyTypeRenderAssembly, it should be the namespace apparently! Then in macroPropertyTypeRenderType is should be the type name (without any assembly name or namespace).
I think your solution didn't work for me because of the way I had set up my assembly in the first place.
Very confusing.
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.