David Lohmeyer's Blog

How to check a user role inside a custom module in Drupal 8

If you need to check for a specific role such as 'administrator' in Drupal 8, the process is changed from past versions. The following is an example of how you'd check for an administrator role when rendering the user edit form. You might do this if you were unsetting form variables based on role:

Drupal 8 Site Building Gotcha: System Blocks

For those starting to build on Drupal 8, some things can be in the same place as Drupal 7 while others can be "hidden". While the idea is to move things to more logical places, sometimes it's confusing to site builders since they have to learn the system anew in some regards.

Side Projects Keep Things Fresh

I've been having fun maintaining my side web design and development "business". It keeps things interesting outside of work since I love making cool things and helping smaller businesses with their online presence. I started hosting client sites earlier this year while I previously used shared plans for side projects and I think it's one of the better decisions I've made. The control of having a VPS that just works without messing with clunky shared plans is liberating.

Sorry, Web Design isn't Dead

I fell for the link bait title. A recent article on UXMag points out why the author thinks web design is dead in 2015.

Check out DigitalOcean for hosting

I've been using Hostmonster for probably 10 years to host my simple personal site and other random projects that come up.  Shared hosting is a convenient thing and is a great solution for people that want a normal website.

Stop Confusing Future Web Developers

Stop for a second.  Have you heard of tools like Jade (an HTML preprocessor) or Stylus (a CSS preprocessor)?

Can we use Flexbox safely yet?

The flex box model, aka Flexbox, will make designing layouts in CSS and HTML a lot easier once it hits mainstream.  How close is it to being widely supported?  It's actually not too bad, with global support at 88.88% as of 3/2/15.  The main issue is with versions of Internet Explorer earlier than 10.  Modern Chrome and Firefox, as well as mobile browsers almost all support Flexbox.  Since this is a new tool that will likely be employed in CSS frameworks of the future, it's useful to know how and why it will happen.  Here are a few good links.

Building a custom arcade (MAME) machine

Last August I took the plunge and decided to build my own custom MAME arcade cabinet.  See my build thread here. I wanted to use this as a learning experience in woodworking.  Here are a few things I learned building off of the plan posted at Arcadecab.com

Website Update

My personal site has been updated.  It's been a few years and it was definitely time to freshen things up.

One thing is notably missing: my old Team Fortress 2 levels.  I'll try to get a compilation blog post of those up shortly.

Repeating blocks of template code in Drupal 8

I've had some trouble using Twig's include statements in Drupal 8 theming.  I'm not sure if this is a bug since it's at Beta 4, but it's sort of annoying.  I include my content areas in page.html.twig in a separate include file in Drupal 6 and insert it into the area I need.  For example, if I have a 3 column layout, I'm changing the Bootstrap classes from "col-md-12" to "col-md-9" and "col-md-3" (for a sidebar) if the sidebars have content in them.  Includes are apparently escaping (?), though, and not printing anything other t

Related Posts