Just wondering if the Views module grid layout is responsive in BD? I see on the showcase page that the two columns do collapse, is this vanilla behavior?

Also do I need extra stuff in the template.php file to use template suggestions based on content types/url/etc?

Currently in D7 I use the code below to allow me to do templates overrides like the ones blow.

node--resources.tpl.php

page--resources.tpl.php

comment-wrapper--node-product_display.tpl.php

function aquaterra_preprocess_page(&$variables, $hook) {
   // Page template suggestions based off of content types
   if (isset($variables['node'])) { 
                $variables['theme_hook_suggestions'][] = 'page__type__'. $variables['node']->type;
                $variables['theme_hook_suggestions'][] = "page__node__" . $variables['node']->nid;
   }
   
   // Page template suggestions based off URL alias
   if (module_exists('path')) {
    $alias = drupal_get_path_alias(str_replace('/edit','',$_GET['q']));
    if ($alias != $_GET['q']) {
      $template_filename = 'page';
      foreach (explode('/', $alias) as $path_part) {
        $template_filename = $template_filename . '__' . $path_part;
        $variables['theme_hook_suggestions'][] = $template_filename;
      }
    }
  }
   
}

 

 

Comments

drop's picture

Out of the box the views grid style is not responsive in Backdrop. It, unfortunately, uses the markup for a HTML table.

We do have an issue to switch this out for the CSS grid property, but we are waiting for better browser support before we put that into core (you can see the issue for that, here: https://github.com/backdrop/backdrop-issues/issues/2811)

For the time being, on backdropcms.org, we have switched the default views-grid template out for one that uses the bootstrap grid system in core, along with a preprocess function to determine which classes to add for which views. See below:

Here's the preprocess function: https://github.com/backdrop-ops/backdropcms.org/blob/master/www/themes/b...

And here's the template file: https://github.com/backdrop-ops/backdropcms.org/blob/master/www/themes/b...