Drupal 8 Taxonomy Terms same level - drupal

I've a pretty simple Drupal 8 installation with this taxonomy:
parent 1
child 1.1
child 1.2
child 1.3
parent 2
child 2.1
child 2.2
parent 3
child 3.1
child 3.2
child 3.3
When i'm on i.e. the child 1.2 taxonomy page (/taxonomy/terms/5) i would like to show child 1.1, 1.2 and 1.3 in a block.
I'm using views to accomplise this, but i can't get it to work. Tried to use a contextual filter on Taxonomy Parent, but no luck onfortunatly

Related

D7 Mixed menu (entity and content translation)

In my main menu I have mostly links to nodes that are translated with entity translation, so one node with the fields translated. But I have two nodes which are translated with content translation, so each node is actually three seperate nodes (three languages). Now I don't know how to implement these content translated nodes in the hierarchy of the menu. To clarify, my menu should look like this:
Main Menu
-Menu Item 1 (entity translation)
-Menu Item 2 (content translation)
--Menu Item 2.1 (content translation)
--Menu Item 2.2 (entity translation)
-Menu Item 3 (entity translation)
My question is this, how do I make a menu item for items 2.1 and 2.2? Since item 2 is actually three seperate nodes I don't know what to configure as the parent of item 2.1 and 2.2.
Thanks, any help is greatly appreciated.

Filter Views in Drupal - select nodes from taxonomy with children

I'm using drupal 7 with views 3. I added some filters to the page and one filter is taxonomy. This taxonomy has a tree structure. Filter is exposed, so the user can change it. Everything works fine but there is one major bug.
Example structure:
Parent 1
Child 1
Child 2
Subchild 1
Parent 2
...
When I select for example Child 1 I can see all the nodes from the child 1 - that's ok. But for example when I choose Child 2 I can't see nodes from Subchild 1. Same situation if I choose Parent 1 - i see only nodes exactly from Parent 1 - Child 1,2 and Subchild 1 are not displayed.
Is it possible to show all children with parent with views? Or maybe I should do something like extract all the children manualy from code, than alter the query and make WHERE IN condition?
All help will be appreciated:)
Use the filter 'Has taxonomy terms (with depth)'

How to show all the content under the parent category?

category 1
subcategory 1
subcategory 2
now, when i click the category 1 it shows all the contents under subcategory 1 and subcategory 2. thank you.
but in the default drupal. although there are some contents under subcategory 1 and subcategory 2 when i click category 1. it shows there no content....
how to invoke all the content under all the subcategory. thank you.
In case you're using Drupal 6, there is a rather simple way to accomplish what you want:
If you are using a hierarchical taxonomy, and want all nodes tagged with child terms to show up also, you can create an URL link like taxonomy/term/2/2 where the second parameter is the depth that the tree will be recursed into, or taxonomy/term/2/all for all child terms.
(from About Taxonomy page)
But it doesn't work in Drupal 7:
In D7, you can no longer specify paths such as "taxonomy/term/1,2", "taxonomy/term/1+2","taxonomy/term/2/2" or "taxonomy/term/2/all". Function taxonomy_term_page (D7) does not parse the string as it did in D6.
So, with Drupal 7 you should use Views module - you can enable and customize pre-created "Taxonomy term" view (will be available on admin/structure/views page right after you enable Views module), or create your own from the scratch.
Also, there is a kind of trick which I've used once before, but it should be used only if you manage a rather small site and you are only one who can add content - just allow to select two items from your vocabulary, and while creating your node choose not only child term but parent term as well.

How to build a menu programmatically (Manually) with Drupal?

I have a menu in Drupal in the following structure:
-Gallery
--Gallery Item 1
--Gallery Item 2
--Gallery Item 3
--Gallery Item 4
-Videos
--Video Item 1
--Video Item 2
--Video Item 3
The Gallery and the Video items in the menu should be loaded dynamically from the content type gallery. My problem is that I don't know how to programmatically build and add menus items in the mentioned structure.
Thanks!
As I have mentioned here, Menu Views is an interesting module for Drupal 7 to automatically generate menu links using Views. It integrates seamlessly with menu modules such as Superfish and Nice Menus.
(PS: my reputation is not high enough to provide more than two links, therefore I have marked the other modules bold instead of providing hyperlinks)
-There's a module only available for Drupal 6 and below called Auto Menu - You can look at the source code and see how it's done, and convert it into a Drupal 7 module. Suggestion: Since its maintainers haven't committed for a long time, it's a chance for you to help out in the Drupal community by submitting your new module for Drupal 7.
-Alternatively, you can use the Views module and create a block to show the titles of your nodes as links, filtering by your desired Content Types and ordering by Content Type as well (to show Gallery items first, then the Video items).
-Plus, check out previous threads on this here and here.

How to create a tree with filtered nodes from drupal taxonomy

I'm trying to create a menu tree in drupal like this:
- term 1
node 1
node 2
- sub-term 1
node 3
node 4
+ sub-term 2
- sub-term 3
node 5
- sub-sub-term 1
node 6
+ term 2
etc.
(Sub-term 2 and term 2 are toggled closed.)
Some requirements:
Output this using something like JQuery Menu to get an interactive tree
Filter the nodes by cck type
Filter the nodes by cck field
Only have terms with nodes or other active terms in them show up
Mark the current node as such, and automatically open the tree to that point
Do I have to write this myself, or are there a combination of modules that can do it? I've got Advanced Taxonomy Blocks, which is pretty close, but it doesn't list the nodes.
Sounds like Taxonomy menu and the DHTML Menu module linked in the previous answer would get you pretty close. You'll need a view for your content to do the filtering. Here is an excerpt about Taxonomy menu from its project page:
Transforms your taxonomy vocabularies into menus with ease!
Features
Custom Menu per vocabulary
Uses the default taxonomy term path or custom paths
Integrate with Views
Integrate with Pathauto: use URL/path aliases
Does not interfere with other menu modules
I think this module will do what you want -- Taxonomy field menu.
It will build a traditional menu based on the connection between terms and nodes.
Just make your own custom menu and use the DHTML Menu module to make it expand/contract on click. Here is an excerpt from its project page:
... uses Javascript to reduce the number of page loads when using nested menus; this is particularly useful with Drupal's administration system.
Ordinarily in Drupal, in order to see the sub-items in a menu, you need to click the link of this item and wait for a full page load. After enabling DHTML Menu, clicking a menu link once will expand it to reveal its sub-items without reloading the page. A double-click on the item will load the page normally. Additionally, a cookie stores which menus are open and which are closed, so that the state of the menus remain consistent as you navigate around the site.

Resources