I created the FAQ using the CERN Components webpage on webtools.web.cern. In my FAQ Content type I have created a Category which corresponds to the subtitle of the FAQ.
I created a view for each category.
I have put all the views on a landing page.
Now, when I add a translation to my content types, the question appears as duplicated on the FAQ page.
I see that in order to categorize the FAQs by topic you created different displays for each one of the categories. This is solution however is partially correct because it can be simplified.
The thing is that the accordion display format supports grouping of nodes by a given field. In other words you can have all the different categories under one view and one display and the view will group them automatically for you.
In order to do that you can follow the following steps. I will attach a GIF right after…
Add the grouping factor as a view field. This factor decides based on which field your nodes will be grouped. In your case the “Categorie” field
In settings of accordion choose the grouping factor. In your case again it should be the Categorie field.
Done. Now the view is automatically grouped by Category.
Also I notice that the page is a Landing Page which is a bit unnecessary given that you only host a view inside. So what you can do is to just create a view page, apply the settings I mention above and done! I applied the settings I mention in a clone site and it appears as the GIF below.
Hi Edoardo and thanks for taking the time.
No, it doesn’t change anything because I have only one category option possible per content. So there wouldn’t be any duplicate anyway.
Something else that I also noticed is that it is better to set the Fields as Display Suite: Content and then set the FAQ display, since you have already implemented it.
Regarding setting the Fields as Display Suite: Content , it is nice because the questions come in blue, but they also become huge, so it is not very aesthetic. If you happen to know why, let me know.
The thing with the big font is a known “issue” but it has an easy solution. Here is the deal: When you set your fields in the display that you use for the FAQ, the title field by default has an h2 wrapper. If you remove this wrapper, the FAQ gets rendered in the way it should. The gif below shows how to quickly solve it.