Hey guys,

I want to provide 2 content types into groups: Articles and Discussions. Each content type will have a list (View) into a tab.

Instead of ask admins to go to the "Nodes" tab, click in "Create content" and select "Article", I want to add a local action inside the Article tab (above the list). It will improve and simplify substantially the user experience.

I know I need a `mymodule.links.action.yml` in order to add the local action. And tried to copy the action inside `gnode` module, but it didn't work.

Do you have any thought on it?

Thanks in advance.

Comments

tregismoreira created an issue.

Mark F’s picture

Have you tried placing the 'Group Operations' block somewhere on the page?

tregismoreira’s picture

Yep, I tried but it doesn't work since `group/%/article` isn't under group context. I couldn't make it read % as a context group. For the same reason, I couldn't use "Group ID from URL" in the contextual filter.

There's any way to do that?

tregismoreira’s picture

Hey, I was comparing my Views with "Group nodes" and figured out that I wasn't using a "Group permission". Once I set a group permission, the block displayed correctly.

Even tough I would like to know how could I add local actions using the group ID as parameter. If you can help me, I thank you.

jidrone’s picture

Hi @tregismoreira,

I recommend you this patch #2813405: Add a field to view and edit content's groups, maybe it doesn't follow the approach you suggested here, but could help for easier content addition to groups.