Description of the need
Redirecting to a node or other entity page is unnecessarily cumbersome. Common approaches include:
// Manual assembly for known entity types:
backdrop_goto('node/' . $node->nid);
// Using URI for general entities:
$uri = $entity->uri();
backdrop_goto($uri['path'], $uri['options']);
// Trying to shorthand the above into a single line:
backdrop_goto($entity->uri()['path']);
Proposed solution
Create a short-hand wrapper function around backdrop_goto() that makes redirecting to entities easier.
function entity_goto(Entity $entity) {
$uri = $entity->uri();
backdrop_goto($uri['path'], $uri['options']);
}
Alternatives that have been considered
Maybe also create $entity->goto() method?
GitHub Issue #:
5838
Recent comments
Out of curiosity: why are these tags only relevant for admins? Don't "regular" editors on that site also need them under circumstances? Yes, the editors play nicely, no problem to...
Specific tags to work in CKEditor 5
Worked like a charm! Exactly what I envisioned... now I can edit the ruby text right in the editor, sweet:) Thank you! For those who may have a similar issue, try TinyMCE, create a new "text...
Specific tags to work in CKEditor 5
Yes, you can use TinyMCE on some content and CKEditor5 in others. There is no problem having both enabled on a system.
Specific tags to work in CKEditor 5