Hi there.
I was thinking of building two custom macro parameters, but I need to transfer IPublished content and IEnumerable(string) as parameters.
Is there somewhere I can see which types are allowed as parameters?
I found this snippet, is says a valueType of "STRING" is allowed. But are there more?
I am not sure their is a nice clean way to pass content and enumerables from macros like there is with other properties.
For property editors, your choices are STRING, TEXT, INT, DATETIME and JSON (see doc)
To pass with content or a list of content items the core property editors either just pass a single contentId as a INT or if there are more a comma delimited list of ints (e.g 1491,2918,1948) (you can see this if you search the umbraco source code for PropertyEditorValueTypes)
if you need to pass a range of values, the best option you have is to use JSON datatype and deserialize the values in your Macro Script once its been passed over.
Custom Macro Parameter options
Hi there. I was thinking of building two custom macro parameters, but I need to transfer IPublished content and IEnumerable(string) as parameters. Is there somewhere I can see which types are allowed as parameters?
I found this snippet, is says a valueType of "STRING" is allowed. But are there more?
Hi,
I am not sure their is a nice clean way to pass content and enumerables from macros like there is with other properties.
For property editors, your choices are
STRING
,TEXT
,INT
,DATETIME
andJSON
(see doc)To pass with content or a list of content items the core property editors either just pass a single contentId as a INT or if there are more a comma delimited list of ints (e.g 1491,2918,1948) (you can see this if you search the umbraco source code for PropertyEditorValueTypes)
if you need to pass a range of values, the best option you have is to use JSON datatype and deserialize the values in your Macro Script once its been passed over.
Kevin
Hi Kevin.
Thanks for info and links. JSON will do just fine!
cheers! /Peter
is working on a reply...