Copied to clipboard

Flag this post as spam?

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


  • Mike Thibault 2 posts 22 karma points
    Jul 30, 2009 @ 23:14
    Mike Thibault
    2

    Custom Macro Parameter Type

    How can you create a custom type for a macro parameter?  I know you can create custom datatypes in the developer section, which by default contains things like "Richtext Editor" and "Ultimate Picker", but I want new types in the macro parameters tab, which has things like "bool" and "number" and "propertyTypePicker".

    Basically I want to have a dropdown that can pull information from an outside database and give an ID to the macro (instead of the user having to look up the ID themselves and type it into a text box), which the macro will then use to display information on a page.

    Thanks,

    Mike

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jul 30, 2009 @ 23:35
    Sebastiaan Janssen
    0

    You'd have to write your own DataType for this.

    Check out some info in this blog post: http://www.nibble.be/?p=24

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Jul 30, 2009 @ 23:35
    Morten Bock
    1

    There is a pretty good writeup on how to do that in this old forum post:

    http://forum.umbraco.org/yaf_postst2224_Extending-macro-datatype.aspx

    Also you may want to check out the project that Ismail created here:

    http://umbracoext.codeplex.com/SourceControl/changeset/view/35482#201463

    It was made for V3, but I imagine it would work fine i V4. It actually does just what you want. Populate a dropdown box based on a provider model. So dig into that code, and you should have all the basics.

     

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Jul 30, 2009 @ 23:36
    Morten Bock
    0

    Sebastiaan > it is not a datatype, but a macrorendering that is needed. It is used for the properties in a macro instead of a document.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jul 30, 2009 @ 23:38
    Sebastiaan Janssen
    0

    Whoops. I wasn't reading properly! Sorry, it's been a long day :-)

  • Mike Thibault 2 posts 22 karma points
    Aug 04, 2009 @ 22:38
    Mike Thibault
    0

    Thanks very much Morten!  That is exactly what I was looking for.

Please Sign in or register to post replies

Write your reply to:

Draft