Is it possible to have a dropdown list as a macroparameter? I only want the user to have four options and if i let him type in the option himself it is bound to fail. Especially since you can't write a instruction text next to the parameter option.
Does not exists ootb, but it could be made quite easily. Just derive from the asp.net dropdown list, implement a single interface IMacroGuiRendering and you're done.
[code]public interface IMacroGuiRendering
{
///
/// Gets or sets the value.
///
///
string Value {set; get;}
///
/// Gets a value indicating whether a caption is shown
///
///
bool ShowCaption {get;}
}[/code]
Thanks, i don't really understand how and where to create this class though. Is there some docs on how to extend a macro like this? Is it possible to include the mod in a package?
It doesn't matter where this class lives, just need to implement this interface. Register the assembly and class name in the database (cmsMacroPropertyType) and you're ready to go.
If you need a help on this, just shout...
Docs on creating a new macro property type? Haven't seen one myself....
Mods in a package? Hmm, sure, I think it can be done using a custom package action that does the db change to register the macro property type.
See http://umbracoext.codeplex.com/Thread/View.aspx?ThreadId=22521 I did something ages ago which provided the ability to add extra functionality to macro properties, its version 3. My old blog is down so the instructions link wont work ill see if i can find the instructions. Download the macrorenderings source update the dll references to v4 should compile. Have a look through the code there is an example implementation of creating drop down with source data coming from csv or xml file.
Could'nt find instuctions but see this post half way down there are some screen shots, this post initially got me going on creating the macrorenderings dll which is on codeplex.
I try to create a new dropdownlist macro parameter and when I insert the macro in my editor, my parameter is not visible.
This is my class:
public class MemberGroupList : DropDownList, IMacroGuiRendering { string _value; public string Value { get { return this.SelectedValue; } set { _value = value; } }
One thing to mention is that you should use the same name for the namespace as for the assembly. I tried with different names but without success. The parameter showed up in the dropdownlist for selecting one, but it didn't render whitin TinyMCE. After changing the name of the namespace to the name of the assembly everthink worked fine.
dropdown as macro parameter
Is it possible to have a dropdown list as a macroparameter? I only want the user to have four options and if i let him type in the option himself it is bound to fail. Especially since you can't write a instruction text next to the parameter option.
Hi Johan,
Does not exists ootb, but it could be made quite easily. Just derive from the asp.net dropdown list, implement a single interface IMacroGuiRendering and you're done.
[code]public interface IMacroGuiRendering
{
///
/// Gets or sets the value.
///
///
string Value {set; get;}
///
/// Gets a value indicating whether a caption is shown
///
///
bool ShowCaption {get;}
}[/code]
Hope this helps.
Regards,
/Dirk
Thanks, i don't really understand how and where to create this class though. Is there some docs on how to extend a macro like this? Is it possible to include the mod in a package?
Hi,
It doesn't matter where this class lives, just need to implement this interface. Register the assembly and class name in the database (cmsMacroPropertyType) and you're ready to go.
If you need a help on this, just shout...
Docs on creating a new macro property type? Haven't seen one myself....
Mods in a package? Hmm, sure, I think it can be done using a custom package action that does the db change to register the macro property type.
Cheers,
/Dirk
Johan,
See http://umbracoext.codeplex.com/Thread/View.aspx?ThreadId=22521 I did something ages ago which provided the ability to add extra functionality to macro properties, its version 3. My old blog is down so the instructions link wont work ill see if i can find the instructions. Download the macrorenderings source update the dll references to v4 should compile. Have a look through the code there is an example implementation of creating drop down with source data coming from csv or xml file.
Regards
Ismail
JOhan,
Could'nt find instuctions but see this post half way down there are some screen shots, this post initially got me going on creating the macrorenderings dll which is on codeplex.
Regards
Ismial
Ismail,
Google had your old post cashed :P
Cashed post
I'm not sure i can pull this of so i think i will put this little project on hold for now.
Hello,
I am in Umbraco 4.0.2.1, .net 3.5
I try to create a new dropdownlist macro parameter and when I insert the macro in my editor, my parameter is not visible.
This is my class:
The parameter is visible in the drop down list of type in the macro parameters tab but nothing in the edit panel when I insert the macro.
Any solutions about my problem please ?
Thanks in advance
One thing to mention is that you should use the same name for the namespace as for the assembly. I tried with different names but without success. The parameter showed up in the dropdownlist for selecting one, but it didn't render whitin TinyMCE. After changing the name of the namespace to the name of the assembly everthink worked fine.
is working on a reply...