Talking Drupal #111 - View Revisited

January 7, 2016

In episode #111 we revisit the topic of Views in Drupal.





  • Formatters
  • Sorting 
  • Filters
  • Views Templates
  • Relationships
  • New in Drupal 8


Module of the Week: 

File Checker

In a perfect Drupal world your server file system and its corresponding entries in Drupal's files table are 100% synchronized. But what if parts of your file system have been corrupted due to some disk failure? Or one of your modules messed up your database and files? Or your deploy script went beserk? Well, then this module will help you to monitor and find out which files are out of sync.



Regarding Johns question about Sublime Text. Yes there is. In case you haven't figured out yet. You have to install sublimelinter (v. 3.6.1) via the package manager. Next sublimelinter-phpcs ( aside for PHP I would recommend sublimelinter-php and sublimelinter-phpmd). Then you have to install via composer:

composer global require "squizlabs/php_codesniffer=*"
composer global require "drupal/coder=*"
composer global require "phpmd/phpmd=*"

Next, set the coding standard for phpcs

phpcs --config-set installed_paths /users/yourusername/.composer/vendor/drupal/coder/coder_sniffer

in case you have another coding standard like e.g. the wordpress coding standard you have to write

phpcs --config-set installed_paths /users/yourusername/.composer/vendor/drupal/coder/coder_sniffer,/users/yourusername/.composer/vendor/wp-coding-standards/wpcs

if you use the ~ instead of the complete path it won't work (as a word of advice). Then the only thing left to do is to set inside the sublimelinter.sublime-settings the following part:

"linters": {
"php": {
"@disable": false,
"args": [],
"excludes": []
"phpcs": {
"@disable": false,
"args": [],
"excludes": [],
"standard": ""
"phpmd": {
"@disable": false,
"args": [],
"excludes": [],
"rulesets": "cleancode,codesize,controversial,design,naming,unusedcode"

now all your PHP files get checked by PHP, PHP CodeSniffer and PHP Mess Detector. On a side note if you want to set the coding standards on a per project basis you are able to do so by choosing from the registered list of codings standards in phpcs. You only have to place a phpcs.xml or phpcs.xml.dist file in the root of your project directory. The content of the xml file looks like that for a Drupal project:

<?xml version="1.0"?>
<ruleset name="phpcsDrupal">
<description>phpcs example for a Drupal project</description>
<rule ref="Drupal"/>

Hope that helps. Cheers Ralf

Ralf - Thanks for the comment! I will check this out!

I am surprised in the whole discussion about Views that it was not mentioned that views filters can be exposed allowing the website user to change the view. I have used this to build custom searches for content.

Frederick - this was a part 2, a companion to the a views show we did easrly in the podcast (   While we tried not to cover the same topics, it's entirely possible we missed that obvious feature in both shows.  We will likely have another shows on Views in the future.

Add new comment