BuddyDev

Search

Is there a way to remove menu items from mediapress like with buddypress?

  • Participant
    Level: Enlightened
    Posts: 40
    Jaume Aragay on #5678

    I want to remove some menu items:
    – The “Edit” item from the Gallery top level menu. ( domain.com/groups/group-name/mediapress/ ).
    – The “Edit” item from the image gallery level. ( domain.com/groups/group-name/mediapress/image-gallery-name ).
    – The 3 items group that shows up for admins in an image gallery: ( “All the galleries, my galleries, create gallery”). If possible I’d like to remove them individually.

    In buddypress I can remove single “nodes” from menu or submenus. Does mediapress work the same way? Any other way to remove them without tweaking the code? If tweaking the code is the only way, what files should I focus on?

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #5680

    Hi Jaume,
    It is easy to do it with mediaPress. We have a well defined API for adding/removing menu nodes from all places. can you please post some screenshot and mark the links you want to be removed?

    Thank you
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 40
    Jaume Aragay on #5683

    When I discover how to upload images, I’ll do it… Meanwhile… Any documentation page I can read to try to find those nodes by myself instead? 😉

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #5686

    Hi Jaume,
    Please take a look here

    https://github.com/buddydev/mediapress/blob/master/mpp-init.php#L209

    For each mpp_add_XYZ there is a mpp_remove_XYZ

    And here are the function definitions
    https://github.com/buddydev/mediapress/blob/master/core/common/mpp-nav-functions.php

    Hope that helps.

  • Participant
    Level: Enlightened
    Posts: 40
    Jaume Aragay on #5688

    The menu items are explained in the original post. Here you have screen captures of the page: http://imgur.com/a/HBZZY

  • Participant
    Level: Enlightened
    Posts: 40
    Jaume Aragay on #5689

    1.- I’ve removed the my galleries setting it to no on the settings page. On thing solved.

    2.- I’ve taken a look to the files for gallery menu edition. Where should I hook the code to apply it to all galleries? To the same mpp_setup_globals hook?

    3.- Which is the file for the media gallery menu edit code? I see instead of a $slug it requires $args. Where do you init it to see the $args you pass to it? And the hook?

  • Participant
    Level: Enlightened
    Posts: 40
    Jaume Aragay on #5697

    Again, these are the edit buttons I want to remove: http://imgur.com/a/zS3X5

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #5704

    HI Jaume,
    Is your intention to disable editing of the galleries? If yes, That is super easy. Else I will post the code to remove the menu item.

  • Participant
    Level: Enlightened
    Posts: 40
    Jaume Aragay on #5709

    I want do disable 2 “Edits”:

    1.- The one for the gallery that brings the second level menu to See, Edit file, Add files, Reorder, etc…
    2.- The “Edit” related to the files inside the gallery where you can “tweak” the “metadata” related to that file. (The Title is shows, the Description, the Status and the “Upload new cover”).

    If this means “disable editing of the galleries” then YES, I want it. (But ALSO disabling the edit of the ITEMS inside the gallery).

    By the way… I think the last item in the breadcrumbs is FIXED. Not available in the translation files as I’ve translated all the EDIT items in the file and the last breadcrumb is still “Edit”.

    • This reply was modified 8 years, 3 months ago by Jaume Aragay.
  • Participant
    Level: Enlightened
    Posts: 40
    Jaume Aragay on #5736

    (Ugly) CSS alternative:

    body.mpp-page-groups.mpp-page-gallery-list.mpp-page-gallery-list-groups #buddypress div#item-body div#subnav,
    body.mpp-page-groups.mpp-page-single-gallery #buddypress div#item-body div#subnav {
    display: none;
    }

    body.mpp-page-groups.mpp-page-gallery-list.mpp-page-gallery-list-groups #buddypress div#item-nav,
    body.mpp-page-groups.mpp-page-single-gallery #buddypress div#item-nav {
    margin-bottom: 20px; // to get some space between menu and next items
    }

    body.mpp-page-groups.mpp-page-single-gallery #buddypress div.mpp-single-gallery-media-list ul.mpp-item-list div.mpp-item-actions.mpp-media-actions a:not(.mpp-delete-media){
    display: none;
    }

    • This reply was modified 8 years, 3 months ago by Jaume Aragay.

You must be logged in to reply to this topic.

This topic is: not resolved