Copied to clipboard

Flag this post as spam?

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


  • Ryan 24 posts 106 karma points
    Apr 22, 2016 @ 23:55
    Ryan
    0

    How can I edit umbraco listview features?

    How would I go about editing this screen? (7.4.x) My client wants a print feature for selected items:

    Print button location on listview

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Apr 23, 2016 @ 09:36
    Marc Goodson
    0

    Hmm Ryan

    I can't see a way of 'registering' a new button in this menu.

    If you have a look at the ListView property editor template:

    https://github.com/umbraco/Umbraco-CMS/blob/75c2b07ad3a093b5b65b6ebd45697687c062f62a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html

    You can see the options that are displayed for the subheader section if anything is selected:

      <umb-editor-sub-header-section ng-if="isAnythingSelected()">
    
                       <umb-button
                           ng-if="options.allowBulkPublish && (buttonPermissions == null || buttonPermissions.canPublish)"
                           type="button"
                           button-style="link"
                           label="Publish"
                           key="actions_publish"
                           icon="icon-globe"
                           action="publish()"
                           disabled="actionInProgress">
                       </umb-button>
    
                       <umb-button
                           ng-if="options.allowBulkUnpublish && (buttonPermissions == null || buttonPermissions.canUnpublish)"
                           type="button"
                           button-style="link"
                           label="Unpublish"
                           key="actions_unpublish"
                           icon="icon-block"
                           action="unpublish()"
                           disabled="actionInProgress">
                       </umb-button>
    

    etc

    So you could create your own ListView property editor based on the core one and use that in your ListViews (if you hack the button into the core one, then each time you upgrade you'll have a maintenance pain)

    Or thinking about it, you could perhaps use the techniques described in this article by Matt Brailsford:

    http://24days.in/umbraco/2015/umbraco-7-back-office-tweaks/

    to divert the backoffice request for the normal listview.html for your own tweaked listview.html view

    On a side note you can add to the Actions menu for a node by creating a MenuRendering event:

    https://our.umbraco.org/documentation/extending/section-trees/trees-v7

    But I think from your description your editors want to tick multiple boxes in the list view and press print, to print them all.

    regards

    Marc

  • Ryan 24 posts 106 karma points
    Apr 23, 2016 @ 10:26
    Ryan
    0

    Thanks. I was hoping the buttons would be implemented in a more dynamic way. Duplicating the listview in my project and hacking the route is probably the way to go. It would be cool if umbraco had a way to attach backend plugin views to nodes instead of having to do http interceptors. That link is really good in the meantime though, thank you.

Please Sign in or register to post replies

Write your reply to:

Draft