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
Glad it works for you! Regarding selecting options, I've just tested the Views Autocomplete Filters module and got it working after I had a look at the README and made sure to use the same...
Can't filter content in a View
You are right, that was it... Now my problem is I would like users being able to select from pre-established options, like a drop down or maybe an autocomplete. For that I would the Autocomplete...
Can't filter content in a View
Here goes the screenshot for the exposed filter config I will try the module you are telling me about. thanks again!
Can't filter content in a View