Copied to clipboard

Flag this post as spam?

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


  • dcmonk 1 post 21 karma points
    Jan 20, 2012 @ 16:12
    dcmonk
    0

    How do I create a control wrapper in Umbraco?

    Hi,

    Here is the scenario.  We have a set of .NET controls, compiled into a DLL. The controls must function both in and out of Umbraco (the controls themselves have no knowledge of their environment).  These controls need certain Umbraco-specific information, such as the current logged in user.

    Our approach for another CMS (same controls) was to make a wrapper that dynamically loads the controls from the assembly via reflection, then renders the controls in Edit or View mode depending on the page state.  The wrapper middle layer is also responsible for looking up certain information in a 3rd party database (just to be clear that I must have a layer of code between Umbraco and the controls, I can't just drop the controls themselves into the Editor)

    Using Umbraco macros, I can drop a wrapper control into the content Editor, and I know that I'm in edit mode so I have control over rendering, but any text boxes or other input-elements aren't usable.  Ideally there would be a pre-publish way to fully render the wrapper and let it work like any normal control (i.e. allow post, changes to selected items, etc.)

    Can I create my own content editor? Am I going about this the wrong way? Any info appreciated.

  • Rodion Novoselov 694 posts 859 karma points
    Jan 20, 2012 @ 16:41
    Rodion Novoselov
    0

    Hi. I haven't ever tried to do it on my own, but I presume that it might be done by creating a custom macro parameter type: http://our.umbraco.org/wiki/how-tos/how-to-create-a-custom-macro-parameter-type - so that you can introduce a custom editor for a certain parameter that would be accessible through inbuilt "Edit macro" dialog.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies