For a certain view, if it returns only one result, you wish to redirect the users to the single result URL? This is possible by choosing the right hook "hook_views_post_render()", here you go (example implementation): /** * Implements hook
Views
function mymodule_update_8000(&$sandbox) { $message = '' // Only create if the redirect view doesn't exist and views is enabled. $new_view_id = 'YOURVIEWID'; if (\Drupal::moduleHandler()->moduleExists('views') && !\Drupal\views\Entity\View
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
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.
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: http://drupal.stackexchange.com/questions/48289/drupal-7-pager-not-disp…). The pager ID can be changed in the pager settings of the view.
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 https://www.drupal.org/node/1109980) and so redirects the user to the front page in most cases.
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.
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!
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 https://drupal.org/node/1689472. 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:
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.
Dir hat dieser Beitrag Zeit und viele Nerven gespart?
Dann würde ich mich sehr über einen leckeren Kaffee freuen! Oder ein spannendes Tech-Buch aus meiner Wunschliste?