Goodbye, Drupal_Goto Command... So How do I Redirect Users?

Drupal_Goto() is dead, long live Drupal_Goto()! Trying to forward your user to a new page with PHP from within Drupal?

There's a years-long discussion on about this, and why we couldn't have our wonderful, precious, easy-like-BASIC-to-remember command to send users on their way, which culminated in statements like this one from "SiliconMind"
To quote "Silicon Mind" from

This is great yet sad example of why Perfect is the enemy of good. In D7 the only thing that was needed in order to alter a redirection, was to implement a hook. A three liner solution. In D8 two files are needed and a bunch of "use" calls that take more lines than the actual implementation itself :( Who the hell will memorize this?


Getting Drupal8 Config and Variable Info with Twig and/or PHP

Drupal8, Symphony2, Twig and PHP - so happy together?

OK, so here we are. Drupal 8 and Twig. No longer can you do things like drupal_get_title() and instead you have to pull variables through a more stringent Model-View-Controller arrangement, specifically Drupal8/Symfony2 and the Twig templating engine. And many Drupal7 commands are gone, so you have to use the object-oriented approach to get information directly in PHP. So here is a progressively-building cheat-sheet of how to pull certain configs and variables using PHP and/or Twig variables specific to Drupal 8:

Get the Drupal8 Site Name and Slogan in PHP


Sabbath Mode Refrigerator Turns Itself Off?

If it's already the Sabbath, how do I press this button to enter Sabbath mode?

Sabbath mode (also known as Shabbot mode or Shabbos mode) refrigerators such as let the fridge turn itself off on the Sabbath day. They do things like disconnect the lights or not allow the compressor to run as a direct response of human interaction. The one in the photo here has a button to press to disable it on the Sabbath, but my question is... What if you don't press the button until the Sabbath? Then you have to press a button to disable technology. Isn't that using technology on the Sabbath? :P


Does Ivory Soap Float?

I was the class clown in Mr. Weirman's 7th grade science class at Homer Junior High School. I think I was trying to get the attention of the ladies, although I didn't yet know why. Dana Schultz, Sue Gadomski, Gina Wz???, Amy ???, even Bonnie? (Remember because of the Bonnie Bell lip gloss hanging on around their necks)

Anyway, I stuck my finger in the "water" and Mr. Weirman almost had a conniption. It wasn't water, it was alcohol or something. And he was afraid I would do that because he was watching me and I was close to the bins, and I think he knew I would figure it out.

Kinda like Brother Gerard - he also knew I was smart but lazy, which is why he ALWAYS called on me when he asked a question from the books, and NEVER called on me when I had an answer I could learn in life, like "Why are the insides of our teeth healthier than the outsides?"


Watching the Top Three Meeting Attendees

Rooms full of people in meetings watch the top three people and take their lead.

The most prominent or outspoken person is the leader, people listen to what he's saying. Then they wait to see if there *is* a second most active person in the discussion, and if so, whether that person agrees or disagrees with the leader. Then they take their queue from the third participant.

If the first two people disagree, the room watches whether the third person leans in one direction or another. If the first two person agree, but others do not, they refrain from commenting if the third person *also* agrees.



Subscribe to All About Todd RSS