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
OMG thank u... you are amazing.
Hiding Blocks for Small Screens
I use a similar module (Tocbot) which uses the same library, but the implementation is different. This is what I use to target the block: @media (max-width: 47.99em) { .js-toc-block.is-...
Hiding Blocks for Small Screens
So the implication is that another module is causing the trouble. Now for the slow process of elimination... Sounds plausible. And good luck with digging...
How to troubleshoot interactive image cropping modules?