0

By default my taxonomy term page lists all articles using this term in 2-columns. I would like to change it to a 1-column layout.

(1) I have created a custom display layout for the taxonomy group:

enter image description here

(2) And selected the one column layout:

enter image description here

Still it doesn't work. Any other changes, like adding a field, do work though. What am I missing?

Note: I did clear the cache.

8
  • Did you clear cache? Is your Taxonomy terms Views Format set to Grid? – prkos Nov 27 '20 at 0:06
  • @prkos yes, cache cleared. Regarding the terms views format I'm not sure if you mean this: "Admin -> Structure -> Views -> Taxonomy term -> Format" which is set to "Format:Unformatted list" – david Nov 27 '20 at 8:12
  • why the downvote? – david Nov 27 '20 at 8:13
  • 1
    Yes, that's the Format I meant. It's not that then. BTW I'm guessing that the downvote was because there isn't enough info in your question to try to even guess what could be the problem. Try inspecting the column elements with dev tools and see which CSS is laying it out in columns. It may give you some clues. Other than that turn off some modules or settings and see if that helps... – prkos Nov 27 '20 at 14:15
  • Thanks for the good tips @prkos. You know I'm relatively new to Drupal and there are so many places where you can customize things. Yes analyzing with dev tools I see there is a "grid layout" e.g. instructor-item col-md-6 col-sm-12. Where else can this be overriden other than the template level? I guess the latter might be the cause. – david Nov 27 '20 at 16:39
0

Thanks to @prkos, it turned out that the root of the problem was located inside the Bootstrap Sub-Theme.

Someone created a (hacky) template override for one specific content type in a generic manner. By renaming the file views-view-unformatted.html.twig to views-view-unformatted--SOME-CONTENT.html.twig it kept the override for the mentioned content item, but also made layouts of other, generic content types work as intended.

3
  • 1
    You found it! You should accept this answer, you explained it in a way it will be useful to others :) This shows how a mismatch between configuration and theme templates can create unexpected problems. It's only one of the reasons I dislike Bootstrap :p – prkos Dec 4 '20 at 21:12
  • Thanks again. Yes, I see, unfortunately some other company made this theme for my company a while ago. OT: What other theming approach would you recommend, while having a responsive basis for the theme? – david Dec 5 '20 at 22:15
  • 1
    I think most if not all themes you can find today are responsive, and there are base themes you can use to build on top of. Bootstrap has many disadvantages in general (this is coming from my own biased opinion of a clean code advocate) but it doesn't mean you can't use it with Drupal and very successfully. Today we have such advanced features that allow you to control the layout through the interface without coding (Layout Builder module). But in your question templates with hard-coded columns/layout were used that overrode LB options. So just be aware of both worlds so they work together. – prkos Dec 5 '20 at 22:47

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.