how to create view that display just 2 level of taxonomy vocabulary
You should be just fine by introducing 2 chained parent relationships. Setting the criterion where parent of the parent is NULL should work.
Well, this is a purely UI way of doing that, which is a pro. The con is that queries with nested relations might become heavy at some point, therefore consider turning on Views cache when you deploy the site.
It's simple. In fact, there is no need to add any relationship in the Views. Just create the taxonomy term view and add a filter criteria of Taxonomy term: Parent term. (see screenshot)
Then set the value to be equal to
''. This will fetch you all the parent terms as they don't have any parent! (
Render node content in page.html.twig level or blocks at node.html.twig level
In a Drupal 8 site design there is expected a view block and a static block in the middle of node content. I've been trying to figure out how to render node content around the block region (in page.html.twig level), render the block region in the middle of the node content (in node.html.twig level) or any other work around, for ages. I imagine one ...
How to hide menu item from high level roles but show for low level
I have 3 roles on site: I created a new page: I manually created a menu item for this page in the top menu. This item should be displayed only for authenticated users, but not admins. Unfortunately, admin as also an authenticated user. So I had to use a trick to disallow access to this page to admins using this access callback: It works but when I ...
Keep secondary level menu visible when node also has a top level link with Drupal?
I have the following menu structure. Node1 and Node2 are top level links. NodeA and NodeB are children of Node2. When your on Node2, NodeA or NodeB a secondary level menu is shown via the menu block module. This secondary menu contains NodeA and NodeB. So far this is working fine. However I also need to add a top level link to NodeB. If I do this, ...
Allow users to edit just the vocabulary that belong to them?
I allow users to create a taxonomy vocabulary. Then I need to be able to give permission to each user to edit their own vocabulary. I looked at the permission page but I don´t see anything like Edit own vocabularies. Is there any way I can accomplish this. Thanks.
Add a vocabulary and a term-reference field or just add a select field?
I have various content types which have sub-types in my Drupal 7 site. e.g. "downloadable resources" content type, and within this there may be reports, presentations. Is there any reason not to add this to a select field with a list of value=>label pairs? Should I create a separate vocabulary for these options and add a new field referencing that ...