Active
Project:
Drupal core
Version:
main
Component:
views.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Mar 2016 at 17:23 UTC
Updated:
6 Jul 2022 at 23:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
aarailfan commentedI was hoping to get some feedback on this. It's not clear to me if this works correctly with any release version of Drupal 8. Can anyone confirm if tabbed views works in D8 and if so, what the steps are to create them?
David Simmons
Comment #3
Zorkiy4 commentedI have the same problem with Drupal 8.0.5.
I did all according to this manual: https://www.youtube.com/watch?v=EoSnUO9KB00
But tabs doesn't appear.
Comment #4
aarailfan commentedThis appears to be fixed in Drupal 8.1.0.
Comment #5
tnfno commentedI am running 8.1.0, still not able to make it work properly.
If I make a view with multiple displays that has path /mypage/1 , /mypage/2 etc , I do get the tabs when I go to /mypage/1 . I have then NOT defined any default tab.
If I make a display with path /mypage and define that as default tab, going to /mypage only gives me this display and no tabs.
What I do not get is what to define as parent ? The default tab I make do not show up in the list. Why does the normal tab has parent option while the default tab does not?
What I want to do is to make a view that generates a normal menu entry and when I click on that menu item I get the view with tabs.
Comment #6
tnfno commentedI have now tested more and the following works if you want to create a new menu item and have a tabbed page :
Comment #7
tnfno commentedOk, this is weird. The above worked yesterday, even after drush cr and cron runs. This morning the tabs are gone and I do not get any tabs at /mypath, but /mypath/tab1 shows the tabs. Only thing I have done is to edit the fields in the view. Anyone that knows how this really works, I am lost and cannot find any proper instructions.
Comment #8
kfcp commentedHello,
I am running version 8.2.0 and face the same problem: no tabs are visible although I have followed all the instructions.
Anyone an idea ?
Thanks
Comment #9
dansmith57 commentedThis will work using module_name.links.menu.yml
I was having the same issue and it seemed a little unstable, used the links.menu.yml file and it has been fine.
Example file contents:
I know this doesn't fix the way the author is saying it should work, just saying that using the yml file has been for me a reliable solution. I am not sure if themes can have a links.menu.yml - confirmation would be great. Thanks!
Comment #10
pengi commentedI have spent a great deal of time over the last few days trying to get drupal 8.2.1 view tabs to work with zero success. In drupal 7 they're easy. On various posts and videos there are 3-4 variations on how to configure so that drupal 8 view tabs work but none work for me.
I have never had exposure to a core issue before. Is this an issue that is likely to take a long time to get fixed and hopefully even documented re how to configure? Is there any way to encourage someone with the appropriate coding skills to have a crack at it?
Comment #11
sutharsan commentedI used the Drupal 8 version of the tutorial, and it worked: https://www.youtube.com/watch?v=hpuRdzyK3jI
Perhaps relevant is the order in which I created view and menu link. I first created both views and second I created a menu link that points to the 'default tab' view.
Comment #12
lendudeThis feels like a duplicate of #2804195: Views does not create parent local task for a default local task, or are they just touching on the same subject?
Comment #13
wturrell commentedThe following uses a single view to create two pages that each have a pair of tabs, Foo and Bar.
(this is using the stable release, 8.2.5)
Instructions:
Is that what everyone was trying to do?
Note your second page needs to have a path under/foo, if it's anything different, that's what'll stop the tabs appearing at all on the first page.
So that could be where people are going wrong.
If anyone knows what the correct technique is for /tabs/foo and /tabs/bar style URLs…
Possibly a case for improving the wording of the Parent menu thing, if we can think of something better?
Comment #14
nehapandya55 commentedThanks wturrell
I have tried to add tabs with many ways but nothing worked for me but #13 helped me to add tabs.
Comment #15
nehapandya55 commentedComment #16
lendude@wturrell Thanks for the detailed steps to make this work. Closing, if there are still questions about how to do this, feel free to reopen.
Comment #17
drugan commented@wturrell
Did you mean displaying /tabs/foo, /tabs/bar, etc.., without /tabs default tab?
If so, there is an attempt:
Note that there is no /tabsparent default tab on the page, though obviously you can visit this page typing manually the path in address bar or clicking at the breadcrumbs' link if you have enabled those. For that case you have a specific views mode page with a redirect link to the page where actual Tabs could be found.
Just visit the /admin/structure/views/view/multitabbed_example page and set up what the content you want to see under the tabs and redirect page. For simplicity purposes I've added only content teasers for each tab and a simple redirect link on the /tabsparent page.
Comment #18
darkdante commentedI followed #17, this is working, but i would like to show tabs when opening /tabsparent as a url.
is it possible to show tab-view below a root url instead having a url like /tabsparent/tab1 to link to?
Thanks.
Comment #19
cvw commentedI had similar problems. Tabs appeared after I rebuilt caches. Maybe menu cache is not updated after modifying a menu link in Views?
Comment #20
raulito1500 commentedAfter read a long history of posts related to this issue I find that my problem was that I hadn't created a menu item with the same url of the default tab. I mean, into my main menu i've created a menu item with "/foo". That's all.
Pd. Make sure of have a Tab Block enabled into your theme.
Comment #21
matt bSorry, this is a bug and needs work. The views tabs do not work out of the box. After trying so many different combinations of tabs, menu items, default tabs, etc, I finally got this working with:
1) Creating a menu item outside of the view
2) Creating a default menu tab with the same name as the menu item and setting the default tab to 'Already exists'
3) Setting the other pages as menu tabs
4) Rebuilding the Cache! (Thank you #19).
This is very frustrating as I have spent hours trying to get this working - it should be much more intuitive!
This is a bug because I should not have to rebuild the cache as a final step to get this working - it should work as soon as I save the view and refresh the page.
Comment #22
drugan commented"Needs work" is for patches being contributed and tested to detect the work needed. Unfortunately, there is no any patch yet.
Comment #23
Ether commentedReally disappointed with the way Drupal 8 was created. I started to use Drupal from version 6, and the version 8 feels like the entirely new system, with errors in the core in version 8.4.
Tabs functionality needs to be fixed, as none of the methods in this topic worked for me (fresh install on pantheon).
Comment #24
drugan commented@Ether
I agree, Drupal 8 has a lot of vital issues ,,not-yet-fixed,, but you should not to complain. Just make a patch or even better a custom module and use it. You can even share it with us if you want.
That's all what we, regular drupalers, can do. Because lead Drupal developers are already achieved everything in their life and now playing with toys like umami-toy.
Comment #25
Ether commented@drugan
Last paragraph does not sound good for the future of the Drupal. And good for things like Backdrop.
Unfortunately, I'm from those >95% who is using Drupal as LEGO. We are not programmers, but platform users. So, we cannot help you with core patching. Anyway, going back to ver. 7 with a hope that at ver. 7 EOL, Backdrop will be more mature.
Спасибо.
Comment #26
manuel.adanMay be this a dup of #2804195: Views does not create parent local task for a default local task?
Comment #27
liquidcms commentedPerhaps my case is slightly different, i have a custom page already defined and i am trying to add a local task (tab) off of this page using Views.
Originally i had a route as:
I added my view and set Tab as Menu Tab. I do not understand the new requirement in D8 to add Parent (which is busted UI as this isn't even available until after i save the Menu setting and then return to it). But as this parent makes no sense as this is menu items and should have nothing to do with this - I leave it as default Main Navigation. Why have we lost D7 concept of adding children tabs based on path? Big loss.
At this point i have no tabs showing.
After reading numerous posts it seems i need to add links entries:
I add these:
Technically i don't think i should need the 2nd one (for the view); but added it anyway. Nice that the error msg tells me that i need to add arg_0 as a route parameter as any documentation/posts i found on this said it should be arg0.
This now gives me tabs when i go to my parent tab (the custom page which i have route entry for). And, the url for the 2nd tab (for my view) does go to the correct view page - BUT, when i am on that page, i do not have any tabs.
Pretty sure this is highlighting at least a couple core bugs (and certainly a lack of documentation).
[EDIT]
Hmm, after a bit more testing i found something even more odd. As you can see from my route above i can pass optional month/day parameters. These do work; but oddly I have found that 02/21 causes no tabs to show up. All other dates i have tested the tabs are displayed. Very strange.
Comment #28
liquidcms commentedComing across a lot of bugs in 8.4 so thought i would upgrade to 8.6-dev to see if any of these issues have been fixed. The odd issue of missing tab on 02/21 is now gone and the tabs appear (as far as i have seen so far) on any variant of my page.
When i click the 2nd tab though i get wsod. Possibly this is due to the Views db update which failed. Will track it down.
Comment #29
liquidcms commentedin 8.4 i had my links.task defined for my View page (which i still don't think should be required as it is redundant info except to define parent; which should be auto defined by path as in D7 - but, to be fair, since switching to 8.6 i havent tried to remove the links.task entry for the view) - my route_parameter was defined as arg_0. Now, i changed it to the var name used in the route and set the path var in my view from % to %routevar. In other words, in route file i have {ebundle}, in links.task i have a route_parameter named ebundle and in my view i set path to reserve/%ebundle/my-reservations.
This fixes the wsod and, also, fixes that there was no tabs visible on my view page.
Perhaps some/all of this would be fixed in 8.4 if the variable names matched up like i have set here (sadly can't find any documentation on it though) - I will give it a try.
Comment #30
liquidcms commentedWorks with 8.4.3 as long as variable names match everywhere.
[EDIT]
Changed with some sort of cache clear (not sure which; possibly with module re-enable). Now I no longer have route_parameters defined in links.tasks and still, in view, i have variable in path match that in routing file (%ebundle). Seems to all work.
Comment #31
Tonton2 commented#21 worked fine for me, thank you mate!
Comment #32
ShannonMcG commented#21 Worked for me. But I got the WSOD error after saving the menu settings in the view. But I was able to go to a different /admin page and clear the caches. The tabs were working after that.
Comment #33
hughworm commentedI've added a patch to https://www.drupal.org/project/drupal/issues/2804195 which I think may also fix this.
Comment #34
frondeau commentedGood job @Matt b,
Those steps work for me.
Than you for your help.
Comment #35
yaach commentedDrupal 8.6.1, still does not work for me!
Comment #36
2dareis2do commentedthanks #13,
succinct and to the point.
Comment #37
ressaAdding tabs in a Views page in Drupal 8.8.2 works fine, following the steps in #13, thanks for sharing @wturrell. I agree that the wording of "Already Exists" doesn't seem totally intuitive ...
Comment #38
rosielWorked in 8.8.4, following #20. Turns out you really do have to add an item in some Menu for /foo, then the tabs work. Otherwise, the paths work, but no tabs. Thanks @raulito1500
Comment #41
agerard commentedPlease let me know if I should create a new issue... I've created 3 working views tabs, but am now struggling with how to get the "parent" menu link to remain active while toggling between tabs. Using a structure like this:
for view page1: /parent_page as the default (main menu link: parent_page)
for view page2: /parent_page/view2
for view page3: /parent_page/view3
When on the default tab, the main menu item parent_page is active, but clicking another tab turns off the active style for that link. I'd just like the parent_page link on the main menu to stay active when switching between tabs, so the user sees all the views as appearing to be under the parent_page navigation. I currently don't have corresponding submenu items under the main menu item "parent_page" - I tried adding them but it made no difference.
I'm definitely not a php wizard but can hack my way through simple modules and templates...Any suggestions would be greatly appreciated!
Comment #45
smustgrave commentedThis still an issue with https://www.drupal.org/project/drupal/issues/2804195?