I have a site where products are shown in different categories using taxonomies. I then use a view that emulates Drupal core's handling of taxonomy/term to generate those pages. Now, in only one of these views pages I want to show a block to the left. Under Manage display for the page in question I have chosen a DS layout (2 column stacked fluid). But I cannot figure out how to get it to work.

I have saved the template in question with one of the suggested names (ds-2col-stacked-fluid--taxonomy-term--51.tpl.php), targeting a specific taxonomy term. I have created a custom field (that shows my custom block) in the DS layout and I have placed that field in the right region and the main content in the left region.

The problem is that this DS template is ignored by Drupal. I assume that the reason is that I should change the template's name to one that targets the view instead? But when I look in the view's theming information there are no hints on how to target a specific taxonomy term or nid with a views display template.

Can anyone help me with some advice on how to reach my goal of showing a block to the left and the views content to the right on the page?

EDITED: As suggested by Baach I enabled theme_debug and this is the output:

<!-- THEME DEBUG -->
<!-- CALL: theme('html') -->
   * html--taxonomy--term--51.tpl.php
   * html--taxonomy--term--%.tpl.php
   * html--taxonomy--term.tpl.php
   * html--taxonomy.tpl.php
   x html.tpl.php
<!-- BEGIN OUTPUT from 'sites/all/themes/mysite/templates/html.tpl.php' -->

So I guess I will have to scrap my DS layout idea and just use the first suggestion above and adapt a html template for my specific page. That should work.

  • Try to clear the cache if is not working follow this tutorial : drupal.org/node/1098068 – Baach Jan 24 '19 at 16:46
  • I always clear the cache after every change, so that's not it. But I didn't create a new folder for the new template. I will try that, thanks. – TBJ Jan 25 '19 at 6:39
  • I tried to create a new folder named ds_layouts and then put my DS layout mentioned in my question in that folder followed by clearing all cache. That did not do the trick either. – TBJ Jan 25 '19 at 6:46
  • try to create a folder named templates under you theme and copy your ds template there – Baach Jan 25 '19 at 10:22
  • Baach: I already have that folder with a bunch of other templates and I have tried to place the ds template there, without success. I think the problem is that the page is generated by Views and that I need to use a views template. – TBJ Jan 25 '19 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.