Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "Group node" #342

Open
msayoung opened this issue Nov 24, 2022 · 2 comments
Open

Remove "Group node" #342

msayoung opened this issue Nov 24, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@msayoung
Copy link
Member

Image

Remove the "Group node" on the add content page

@msayoung msayoung changed the title Remove Group node Remove "Group node" Nov 24, 2022
@msayoung msayoung added the bug Something isn't working label Dec 6, 2022
@kiwimind kiwimind self-assigned this Jul 10, 2023
@kiwimind
Copy link

kiwimind commented Jul 10, 2023

So far have a couple of options here:

Either going down the preg_match() route or rebuilding the link using existing arguments.


  // Remove "Group node" from title on node add forms within group.
  $page_title = $variables['title']->render();
  preg_match('/Add Group node \((.*)\)/', $page_title, $matches);
  if ($matches[1]) {
    $variables['title'] = t('Add @type', ['@type' => $matches[1]]);
  }

or

  // Remove "Group node" from title on node add forms within group.
  $page_title = $variables['title']->__toString();
  if (str_starts_with($page_title, 'Add Group node')) {
    $variables['title'] = t($variables['title']->getUntranslatedString(), ['@name' => $variables['title']->getArguments()['@name']->getArguments()['@type']]);
  }

@kiwimind
Copy link

Having spoken with @rupertj it appears that the proper way of doing this is adding a service that points to a custom UI Text Provider (or something similar).

Feels a bit beyond me, but I may poke it with a stick to see what happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo (sprint 14)
Development

No branches or pull requests

2 participants