Drupal 8: Delete view programmatically

If you should run into the same situation, that you'd like to delete a view programmatically, for example on module uninstall, here you go:

  1. \Drupal::service('config.factory')->getEditable('views.view.' . $view_name)->delete();

Drupal 8: Override views row (views-view-fields.html.twig) in views style plugin

In the last days I developed the ZURB Foundation Views integration module for Drupal 8. To match the markup required by foundation accordion we first had to write a views style plugin in our module.

Linktipp: Drupal 7 Views 3: Search in nodes via Search API with node as base table (does not seem possible)

Note to myself: If you used the search.module (Core) before and switch to Search API, there seems to be no valid replacement for Views search fields if using "node" as base table.

You have to use the search api tables as base table like documented in the linked document below.

Please tell me, if there is an other solution. Converting all views is simply too big.

Drupal 7: Views Pager missing? Are you using views_php (+ views_litepager) perhaps? Or simply a problem with pager id?

Yesterday I ran into a mysterious issue. Some views pagers were completely missing and the typical fix to change the Pager ID (if there are multiple pagers on the same page) did not help (example: The pager ID can be changed in the pager settings of the view.

Drupal 7 Views (3) add AJAXified RESET button for views exposed filters

Drupal 7 Views (3) provides great functionality. However the optionally provided "Reset" button for exposed filters does not work nice with AJAX.
If it is clicked it:

  • Does not fire via AJAX but loads a whole new page
  • Has a problem with the URL (see and so redirects the user to the front page in most cases.

Drupal Commerce: Add "Update cart" button on top of cart view

Today I'd like to provide a short snippet (hook) to add an additional "Update cart" button on top of the cart view in commerce.module.

  1. /**
  2.  * Implements hook_form_FORM-ID_alter.
  3.  * @param type $form
  4.  * @param type $form_state
  5.  */
  6. function MY-MODULE_form_views_form_commerce_cart_form_default_alter(&$form, &$form_state) {

Drupal 7 + Views 3 + hook_views_data + Date field (Filter / Sortierung / Handler)

Drupal 7 custom date field filter handlers

Drupal 7 Views (3) und Datums-Felder hassen sich! Das Gefühl werde ich einfach nicht los... besonders schlimm ist es anscheinend mit der Dokumentation dieser Kombination. Aber gehen wir ins Detail... und kommen zur Lösung!

Howto Drupal 7 Views 3 add class attribute to tables in views table format

Sometimes you wish to have a class to identify views tables. But currently views does not provide such a class attribute in the <table> element.

So there's an issue about that in

In #20 cybercampbell mentions a workaround solution until it is clear, if this will be solved in views too. I think it is worth mentioning it as a snippet:


Linktipp: Drupal 7 Views: Views Combine Filter zur feldübergreifenden Suche

Sven Culley hat unter der unten angebenenen URL eine schöne kurze Information zu den neuen Views Filtern: "Global: Combine fields filter" erstellt.

Mit dem neuen Feature kann eine Sucheingabe über mehrere zu durchsuchende Felder hinweg Ergebnisse liefern. Ein Blick lohnt sich!

Drupal 7 Referenzfeld-Auswahl (Field Reference) via Views entsprechend der Benutzerrolle einschränken

Drupal (7) Referenzauswahl-Felder (Node / User Reference) haben häufig bestimmte Anforderungen bezüglich ihrer Auswahlwerte. Möchte man so beispielsweise nicht nur alle Nodes eines Typs anbieten, sondern nur "Eigene" Inhalte eines Benutzers, wird es schon schwieriger.