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
Thank you for your positive response. I guess English is not your first language but it seems like you found the Devel setting for theme debug where it suggests templates and found that useful. You...
Create a new theme - Starter theme
Great. I can confirm this fixed the issue. Thanks.
Disappearing administration bar. Is this a Leaflet or a Backdrop bug?
After some hesitation as to how much BACKDROP CMS work is needed to create a custom theme for a website, I am pretty sure that this CMS is a good alternative between DRUPAL(welcome in Symfony)...
Create a new theme - Starter theme