Content Modeling in Drupal 8

In many modern frameworks, data modeling is done by building out database tables. In Drupal, we use a web-based interface to build our models. This interface makes building the database accessible for people with no database experience. However, this easy access can lead to overly complex content models because it’s so easy to build out advanced structures with a few hours of clicking. It’s surprising how often Drupal developers are expected to be content modeling experts.

Read On →

Ask Ubuntu is an Internet Black Hole

The content on Ask Ubuntu is licensed CC attribution required. However, the content isn’t licensed by the people who WRITE the content, but by the owners of the website who host the content. Evil? Probably. Update: Chris points out in the comments that Stack Exchange gives users with 2000 reputation points do follow links to their home page. That means when someone borrows an author’s content to answer a stack exchange question, the person who copies gets a reward and the author does not.

Read On →

Best WordPress Plugins I'm Excited About

The short list of Plugins I’m excited about: Google Analytics by Yoast loads your Google analytics asynchronously to speed up your page loads. Yoast’s Best WordPress SEO plugin recommended by Hobo SEO Amazon Affiliate Linker adds your Amazon Affiliate code to all amazon links on your site. I’ll keep adding to this list as I find more plugins to play with.

Read On →

Decode your WordPress content to UTF-8

Ann Smarty recently posted an article about how scammers use foreign characters to disguise duplicate content as unique, original content. If you’ve never seen this before, go read her post. It’s really interesting. No really. Read it. http://www.seosmarty.com/content-scam-alert-using-foreign-characters-to-make-the-piece-look-unique/ She had several great suggestions for catching the hidden characters, but, checking every guest post by hand is bound to fail eventually. You’ll either get bored of never catching hidden content, or you’ll just forget about.

Read On →

Drupal 7 AJAX Forms

Using AJAX to update a Drupal 7 form could be easier. The documentation on this feature is extremely verbose, and I had a difficult time piecing together a working example. So, here’s the code to modify the values of a second field when the value of the first is selected. The code below will use the taxonomy_voc drop down to control the product model drop down values. This code does not work with field widgets that define their own AJAX.

Read On →

Drupal 7 Import content with custom fields, images, and taxonomy

I’m in the process of migrating an old PHP website for Portland State University from a custom database into Drupal 7. Doing the data entry on hundreds of nodes with multiple custom fields, taxonomies, and images would have taken ages. So, instead I imported the data into Drupal with a PHP script. At first, I attempted to use phpMyAdmin, to export a CSV, and then import the CSV using the Feeds module.

Read On →

Drupal 8 Admin Best Practices

Drupal sites often suffer from a less than ideal editor experience. While Drupal 8 improves on the default experience by providing inline editting, working preview, and moving the ‘advanced’ options to the sidebar, there’s still common mistakes that will lead to poor a experience. As a part of my on-going Drupal 8 Best Practices series, lets look at what we can do to build good admin interfaces. Here are a few major principles behind the admin experience: Use as few content types as reasonable.

Read On →

Drupal 8 Breadcrumbs - Add the Current Page

Breadcrumbs are a pain point in Drupal 7. If you don’t know how breadcrumbs are supposed to work, go read this. The crumb should start with home and continue through to an unlinked crumb of the current page. Crumbs were implemented poorly, and breadcrumbs were difficult to modify in a module. Further, they were based on items in the menu. The breadcrumbs didn’t even allow you to edit the home title or include the current page title as an unlinked crumb.

Read On →

Drupal 8 Configuration Workflow Best Practices

Don’t store site configuration in the database during development because putting configuration in the database makes configuration difficult to track in version control. Instead, use the file system! Putting configuration in a database also makes it more difficult to restore, compare, sync, deploy, modify, and review the site config. Drupal 8 uses Yml files for configuration which are a perfect format for file-based configuration. In fact, this is the only method for storing configuration in BackdropCMS because BackdropCMS uses JSON files to store site configuration.

Read On →

Drupal 8 Development Best Practices

These core concepts apply to Drupal 8 site builds. However, many often apply to the other major web framework from WordPress to Node projects. Many of these ideas are documented on Drupal.org as well. I’m rewriting them here because I disagree with the documentation in several key areas. Use The Same Development Environment Everyone on your team should have exactly the same development environment. Using the same development environment ensures that the project runs exactly the same for each team member working on a project.

Read On →