Copied to clipboard

Flag this post as spam?

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


  • Jannich Ibsen 10 posts 90 karma points
    Jul 20, 2018 @ 22:41
    Jannich Ibsen
    0

    Add items to "Create items under ..." Menu

    Is it possible to programmatically add custom actions / items to the "Create items under ..." menu?

    I have tried adding menuitems in the MenuRendering event, but these seem to end up in the context menu for the node.

    What i am trying to achieve is to give the editor the possibility of creating, essentially content templates, but with subpages as well.

    Create item under menu

  • Jan Skovgaard 11264 posts 23592 karma points MVP 9x admin c-trib
    Jul 21, 2018 @ 09:45
    Jan Skovgaard
    0

    Hi Jannich and welcome to our :-)

    It is indeed possible to extend the context menu with some custom options.

    There is an article on how to do it here http://codepharaoh.co.uk/articles/creating-a-custom-context-menu-item-in-umbraco-7/

    Hope this helps!

    /Jan

  • Jannich Ibsen 10 posts 90 karma points
    Jul 21, 2018 @ 16:33
    Jannich Ibsen
    0

    Thanks for your reply.

    That is is also the sample i followed. And it shows the item in the context menu (Right clicking on the page item). But i wanted to add additional items to the create menu (when clicking the three dots on the page item).

    The menu rendering event do get triggered when clicking the three dots, but the menu items belongs to the context menu, and this also where my additional menu item shows up.

    Hope it makes sense, as i dont have my code nearby at the moment

  • Dan Diplo 1553 posts 6170 karma points MVP 4x c-trib
    Jul 23, 2018 @ 08:04
    Dan Diplo
    0

    All the documentation for tree events can be found here: https://our.umbraco.com/Documentation/Extending/Section-Trees/trees-v7

    But I'm not sure you can add items to the Create menu - this list is based on document types and is populated automatically.

    You could probably achieve what you want, though, by hooking into the ContentService events. If you use the Saving (or maybe Saved) events and then check the entity is new (ie. just created) and the doc type alias you can then programatically create child nodes of the new page using the ContentService. This would create your sub-pages for you. You might need to have two different document types eg. Contact and ContactWithSubPages and detect the alias and then perform the creation.

Please Sign in or register to post replies

Write your reply to:

Draft