Unfortunately (although intuitively you'd think you'd be able to) you can't use a DataType as a Macro Parameter.
But you can use the underlying Property Editor as a Macro Parameter.
But depending on what the underlying Property Editor is, there may be a few tricks required to get it to work, for example the definition of the property editor needs to have the isParameterEditor set to true, to appear as an option in the Macro Parameter dropdown.
There is some info here on Macro Parameter editors:
So what have you tried, and what did you get from that?
If you want to create your own datatype for use in macros, check the documentation link Marc provided. Basically all you need is a boolean value in your package.manifest, to have it appear as a parameter editor.
Note, you can't configure parameter editors in the backoffice, like you can with datatypes. This was the reason I made the package for generating parameter editors based on data types.
Can i use Datatypes in Macro?
I want to use custom datatype in the Macro parameter. How do I use that in Macro Parameter?
Hi Kalpesh
Unfortunately (although intuitively you'd think you'd be able to) you can't use a DataType as a Macro Parameter.
But you can use the underlying Property Editor as a Macro Parameter.
But depending on what the underlying Property Editor is, there may be a few tricks required to get it to work, for example the definition of the property editor needs to have the isParameterEditor set to true, to appear as an option in the Macro Parameter dropdown.
There is some info here on Macro Parameter editors:
https://our.umbraco.com/Documentation/Extending/Macro-Parameter-Editors/
But more excitingly there is a package here by Søren Kottal:
https://our.umbraco.com/projects/developer-tools/parameter-editor-generator/
designed to help you generate Macro Parameters that you can use in your Macros, based on a property editor you'd normally use in a Data Type.
If that makes sense!
regards
Marc
Thanks for your reply. I went through your links but still, My problem is not resolved. Do you have an alternate way for the same?
So what have you tried, and what did you get from that?
If you want to create your own datatype for use in macros, check the documentation link Marc provided. Basically all you need is a boolean value in your package.manifest, to have it appear as a parameter editor.
Note, you can't configure parameter editors in the backoffice, like you can with datatypes. This was the reason I made the package for generating parameter editors based on data types.
I'd like to see this updated for Umbraco v8
For Umbraco v8? I don't think so
is working on a reply...