4

I can't get views tabs to work in D8, following the exact UI procedure that does work in D7.

To be more precise, in D8 at /mypage I see no tabs at all, and at /mypage/tab2 and /mypage/tab3 I do see tabs "tab2" and tab3" but no "MyDefaultTab".

In D7, I see all 3 tabs when viewing any of the 3 URLs.

The following procedure works to create a Views page with tabs in D7 on simplytest.me, but does not work for D8 beta 15:

  • Manage > Structure > Views > Add new view
  • View name = "Myview"; Show "Content" of type "all"; save and edit.
  • Add page display; name="MyPage"; path = "mypage"; menu = "Normal menu entry" with menutitle ="MyPage" and parent="" (its default value) and weight=0;
  • Add page display; name="MyDefaultTab"; path="mypage/defaulttab"; menu = "Default menu tab" with menutitle ="DefaultTab" and parent menu item ="Already exists";
  • Add page display; name="tab2"; path="mypage/tab2"; menu="Menu tab" with menutitle="Tab2" and parent ="" (its default value) and weight=0.
  • Add page display; name="tab3"; path="mypage/tab3"; menu="Menu tab" with menutitle="Tab3" and parent ="" (its default value) and weight=0.

Is this a D8 bug, or am I missing something?

Things I have tried (all made no difference, good or bad):

  • Selecting "MyPage" (the non default but sensible seeming value) in the "parent" drop down for tab2 and tab3 (there are more menu options available in D8 than D7).
  • Selecting "Normal menu item" instead of "Already exists" for the parent menu item of the default tab.
  • Configuration > Performance > Clear All Caches

Any suggestions?

14

I have just created a views page with tabs. Following are the instructions. Add a views display of type page

  1. Set its path to "/test" Then its menu option: Select "Default menu tab" and on next screen select "Already exist" under the "parent menu item".

  2. Then adds another page display set its path to "test/tab1" and in its menu option: select "Menu tab" and save.

Visit the "/test" page and both tabs appear. Hope it may help you.

  • You're right Ahmad, that works. Thanks! It therefore seems that Drupal 8 uses a different approach to Drupal 7, where the "default menu tab" was used for a kind of dummy page display whose contents were mostly ignored but which did create the default tab. In D8 this dummy page display is not needed. – Jonathan Sep 10 '15 at 17:40
  • Can you please accept the answer? So that it may help others that this solution works. – Ahmad Sep 11 '15 at 5:35
1

If you want your tabs displayed /tabsparent/tab1, /tabsparent/tab2, etc.., without /tabsparent default tab, please visit https://www.drupal.org/node/2693069#comment-12025897 page.

Just import configuration files on the link with ready to use view and see the difference.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.