Copied to clipboard

Flag this post as spam?

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


  • Yan Xuekai 12 posts 42 karma points
    Nov 04, 2011 @ 05:40
    Yan Xuekai
    0

    create a marco programmatically

    I want to create a macro programmatically, I can use macro.xslt or macro.scripting file to create a xslt or script macro, but how can i create a macro using a .net control programmatically?           

                Macro macro = Macro.MakeNew(name);
                macro.Xslt= controlUrl;
                macro.Save();

  • Markus Johansson 1945 posts 5898 karma points MVP 2x c-trib
    Nov 04, 2011 @ 06:45
    Markus Johansson
    0

    Have a look at the Umbraco soure-code, search for the iAction to create a new macro of the type you want. That should contain some useful inspiration.

    EDIT: I was talking about the ITaskReturnUrl-interface. The IAction-interface are used to create actions in the "right click menu" aka context menu.

  • Yan Xuekai 12 posts 42 karma points
    Nov 04, 2011 @ 07:30
    Yan Xuekai
    0

    Hi, markus, thanks for your reply, I have searched some keywords, but still not get the proper result, can you give me some proposals for the search keywords?

  • Markus Johansson 1945 posts 5898 karma points MVP 2x c-trib
    Nov 04, 2011 @ 07:36
    Markus Johansson
    0

    Your welcome!

    Have a look at: /umbraco/presentation/umbraco/create/macroTasks.cs and DLRScriptingTasks.cs in the same folder.

     

    :D

  • Yan Xuekai 12 posts 42 karma points
    Nov 04, 2011 @ 10:32
    Yan Xuekai
    0

    The problem has been solved, just use "marco.Type = controlUrl"

  • 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