By flaviovs on
I'm trying to display two views as tabs on a specific node of my site. After some hours my head hurts and I still could not figure out how to to it.
These are the steps I took:
- Created node page. Path alias:
foo - Created page display on view. Menu as normal (not default) tab, path:
foo/view1 - Created another page display on same view. Menu as normal tab, path:
foo/view2
However, when I go to foo there' s no tab other than the standard "View" and "Edit". If I go to foo/view1 or foo/view2 directly, I can see the view results, but also no tabs.
Isn't the steps above supposed to do the task?
A also tried to alias foo to foo/view to no avail — and with this change, when I go to foo I get a 404.
Am I missing something?
Comments
Tabs are added based on the
Tabs are added based on the actual path, not the alias path. To add the tabs to a specific node the path must be in the form of
node/#/view1were # is the desired node.You will also need to make an alias for each tab you are adding or install the Sub-path URL Aliases module.
Thanks for the reply. Already
Thanks for the reply.
Already tested this.
Did the test again, just in case:
Does it work for you?
FVS - https://dmarcpal.com - https://send2t.com
Sorry, I forgot something
Sorry, I forgot something important. Even if you only want the tab on one node, you style have to construct the path using an argument or the system doesn't put it in the node.
Try using
node/%/view1for the path. You will have to add an argument. It doesn't matter what the argument is, but let's use Node: Nid.Change the following settings for the new argument.
Action to take if argument is not present: Hide view / Page not found (404)
Validator: PHP Code
PHP validate code:
Everything else should be ok. This should give you a tab that only shows up on node 45.
It works!
Many thanks, Cybergarou.
It's working perfectly now!
FVS - https://dmarcpal.com - https://send2t.com