ui_patterns
ui_patterns copied to clipboard
Support AJAX Views / Fix live preview detection
A while back there was an issue to fix the live preview detection #156 which was reported as fixed in #185 . However that fix only fixes views that are embedded with views_embed_view and the issue of rows not rendering correctly persists for ajax enabled views (as reported in #239 ).
I believe that when views is rendering a view on the views UI config page, a special "live_preview" property is set. We should be checking for that instead of just $view->preview
. This should fix it for both AJAX views and embedded views I believe rendering the need for the $view->element['#embed']
check redundant.
Additionally, I'm curious why we don't just let the pattern render in the views live preview? I know most people use an admin theme so the styles won't be loaded, but the pattern template still loads so at least you can preview that your pattern markup and field mappings are working as expected.
Moved to drupal.org : https://www.drupal.org/project/ui_patterns/issues/3315661