A common error on Drupal 7 running on PHP 7: Fatal error: Only variables can be passed by reference in C:\xampp\htdocs\xxx\sites\all\modules\commerce\modules\cart\commerce_cart.module on line 1344



In a previous blog post, we explained what hierarchical paths are, gave examples, and solved a problem with the pathauto module of Drupal 7 that caused certain links to contain a buggy "front" slug.

In this blog post, we will go deeper into all the issues that come with implementing a proper URL paths hierarchy in Drupal 7 and try to propose working solutions where possible.

Normally, templates come in default by printing all content fields by:

<?php print render($content); ?>

But if for some reason, you wish to display everything, yet you need to exclude or omit certain field values from displaying, you may want to use:



print render($content);


In above example this will output everything by default, yet hide the image of the node.

As of Drupal Media module version 2 and 3, there are a lot of modules, contributed or custom which have yet to upgrade its code to complement with Media's major overhaul. Notably, this error I kept encountering with Drupal 7 projects:

Fatal error: Call to undefined function media_include_browser_js() in

To troubleshoot and fix this:


You may consider using PHP for this.

  1. Go to your Views
  2. Header > Add
  3. Select Global: PHP
  4. Use PHP snippet below to display the current term description
  5. You may use additional fields as necessary, arguments, arrays, etc.
<?php $current = taxonomy_term_load(arg(2)); ?>
<?php if ($current): ?>
    <div class="taxonomy-description">
        <?php echo $current->description; ?>
<?php endif; ?>

Views can do this. Views is a UI for sql searches so you are setting the definition for the query that will be made of the content database.

  1. Create a view to display a taxonomy term with a page with a path configured along this line category/%. The % is a wildcard that will make the view respond to any value applied in the URL that matches this format.

  2. Set up your display and any filters desired.

We all know by now Drupal 7 Views is powerful enough to filter and display dynamically any content in various and flexible ways, and the options are endless. It's just a matter of how and where you want it set up.


  • You have a Content Type (Node), let's say a content type called "Blogs" where content items added may be "Article about Drupal 7", "Article about Drupal 8", "Article about Joomla", "Article about Magento", and list goes on and etc.
  • You have a friendly URL based structure (probably using a Path Auto module generated URL aliases for your content types, content nodes, taxonomy vocabulary and terms)
  • You have a Taxonomy and Terms setup such as: "Blog Category" (Vocabulary), then listed under this are terms such as "Drupal", "Joomla", "Magento", and etc.
  • You want to display all blog contents in your block for this to show on any blog sections, listings or blog pages - no problem you can do that with the filter criteria alone (filtering by Content Type), then under Structure > Blocks adjust this block to show where needed (show in specific URLs only among other choices)
  • You want to display all contents "tagged" or categorized under a specific term in your block

How to Use Contextual Filters to show Blocks dynamically according to Taxonomy Term

  1. Set-up your block to display content, fields, etc. as required - format settings, fields settings, may also include setting up Relationships to show fields from other Content Types, entities, etc.
  2. Under Contextual Filters, add Taxonomy term: Name
  3. Under "When the Filter Value is NOT Available", choose "Provide default value"
  4. Under "Type", choose "Raw Value from URL" - this is due to your requirement to show blocks according to for example /blogs/category/drupal (this URL being the term listing or feed for "Drupal")
  5. In our example, "Path Component" is set to 3, because we want to target the term "drupal" in the URL /blogs/category/drupal (drupal being in the third placement of the URL)
  6. Check "Use path alias"
  7. Save then test by typing in drupal in your preview
  8. Enable the block in Structure > Block, then viola!Drupal-Views-Block-Display-Content-According-Taxonomy-Term.png