Would it be possible to have an option in the theme options to remove the + Add New Group, Topic, Event from the main navigation?

I don't see a menu for this item. It would have been nice to just let the user configure this menu by creating a Menu under structure.

I hope you implement this change but in the mean time, where can we go to remove this item.

Which file in the social folder has this menu? As a temporary solution, we would remove it from there even if it gets rewritten in the next open social update.

CommentFileSizeAuthor
add new.jpg26.03 KBtepelena

Comments

tepelena created an issue. See original summary.

tepelena’s picture

I am looking at this file
/profiles/contrib/social/modules/social_features/social_user/src/Plugin/Block/AccountHeaderBlock.php

How do I modify this code to hide the + Add new content button from the main navigation.

 if ($account->isAuthenticated()) {
      $menu_items['create'] = [
        '#type' => 'account_header_element',
        '#title' => $this->t('Create New Content'),
        '#url' => Url::fromRoute('<none>'),
        '#icon' => 'add_box',
        '#label' => $this->t('New Content'),
      ];

      // Gather the content creation links from all modules.
      // Weights can be used to order the subitems of an account_header_element.
      $create_links = $this->moduleHandler->invokeAll('social_user_account_header_create_links', [$context]);

      // Allow modules to alter the defined content creation links.
      $this->moduleHandler->alter('social_user_account_header_create_links', $create_links, $context);

      // Add the create links as children of the create content menu item.
      $menu_items['create'] += $create_links;
tepelena’s picture

Btw since it may be too much work to modify this menu.
Can you add an option under Navigation Settings to Hide it?

Same thing as My Groups. Administration Configuration Open Social Settings

Display the Create New Content icon in the main navigation

tepelena’s picture

Temporary solution.

CSS

Edit: //public_html/profiles/contrib/social/themes/socialblue/assets/css/base.css

Add

.navbar-user ul > li:first-child {
display:none !Important;
}

xinyuma’s picture

Hello,

Would you mind to explain why you would like to have the '+' button removed? This button is designed to make it easier for community members to create content.

Thank you!

xinyuma’s picture

Version: 8.x-6.x-dev » 8.x-7.x-dev
Status: Active » Postponed (maintainer needs more info)
tepelena’s picture

We have multiple content types that the user can create.

Also we are not using groups.

We have created our own Add menu that excludes groups and has other content types that can be added.

There are menu items in OS that are hard coded. This is not ideal. We can use drupal menu to customize menus as needed.

xinyuma’s picture

Status: Postponed (maintainer needs more info) » Active

Good point!

jaapjan’s picture

Priority: Major » Normal
Status: Active » Closed (won't fix)

We are making some assumptions for this menu, that's right. But if your custom use-case is not suitable there are many ways to adjust as needed.

You can create a custom block based on AccountHeaderBlock and alter any way you like.

The + is not a menu, but a block by design. You can disable/remove the block on the normal block administration page /admin/structure/block. Hope that helps!