Copied to clipboard

Flag this post as spam?

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


  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Jul 23, 2013 @ 11:47
    Warren Buckley
    0

    Custom Macro Parameter Type - without DB entry?

    Hello all,
    I am wanting to create a custom Umbraco macro parameter type that lists all document type, but excludes some document types that the editor should never select, hence the need to create my own custom macro parameter type.

    I have seen the documentation & Richard S' blog post on the topiuc but both discuss about adding a DB entry to a table for it to be registered.
    https://github.com/umbraco/Umbraco4Docs/blob/master/Documentation/Extending-Umbraco/Macro-Parameter-Editors/index.md

    http://www.richardsoeteman.net/2010/01/04/CreateACustomMacroParameterType.aspx

    As I am making this part of a package I ideally dont want to add and remove DB entries for the install & uninstall of this package. Is there a smart way of just by registering the class that I need to inherit that Umbraco will automagically register it and add it to the Umbraco back office without having to add items to the DB for this?

    Love to hear what you think.

    Cheers,
    Warren :)

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Jul 23, 2013 @ 11:59
    Ismail Mayat
    0

    Warren,

    I haven't seen anything different when looking to create custom macro parameters but I may be wrong.

    Regards

    Ismail

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 23, 2013 @ 12:06
    Dirk De Grave
    0

    Go on warren, i can see a pull request/feature request coming.

    And what ismael says, you can't without adding a db entry.

     

    /Dirk

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Jul 23, 2013 @ 12:07
    Warren Buckley
    0

    @Dirk is there any places in the core codebase I can look to see where other items get automatically registered on App Startup of Umbraco, so I can try and hack this in with a pull request.

    Cheers,
    Warren :) 

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Jul 23, 2013 @ 12:07
    Ismail Mayat
    0

    That said was'nt there a gui for doing this kind of stuff or am I imaging things?

    Ismail

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 23, 2013 @ 12:11
    Dirk De Grave
    0

    @Ismael: you might be  hit by the current hot temperatures. Haven't seen such a thing (yet)

    @Warren: Check you log file in App_data folder, should have some entries on classes which are discovered during startup (Eg. not found handlers, IAction's, maybe even base/rest extensions which you can declare using attributes). 

    /Dirk

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Jul 23, 2013 @ 12:18
    Warren Buckley
    0

    Thanks Dirk I may look at how Tim G implemented the Base/Rest extensions with Data Attributes, as I can read his
    code as opposed to some of the more hard core Umbraco core devs :)

    Cheers,
    Warren :) 

  • Jamie Howarth 306 posts 773 karma points c-trib
    Jul 23, 2013 @ 14:30
    Jamie Howarth
    0

    I smell a TypeFinder patch coming in...

Please Sign in or register to post replies

Write your reply to:

Draft