Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • kalpesh 7 posts 77 karma points
    Aug 07, 2018 @ 14:54
    kalpesh
    0

    Can i use Datatypes in Macro?

    I want to use custom datatype in the Macro parameter. How do I use that in Macro Parameter?

  • Marc Goodson 1002 posts 6597 karma points MVP 4x c-trib
    Aug 07, 2018 @ 18:47
    Marc Goodson
    1

    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

  • kalpesh 7 posts 77 karma points
    Aug 08, 2018 @ 06:00
    kalpesh
    0

    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?

  • Søren Kottal 440 posts 2692 karma points MVP c-trib
    Aug 08, 2018 @ 06:48
    Søren Kottal
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft