Tabs

Description

This solution will show you how to create tabs.

Code

There are 2 control tags you will have to use: [[tabview]] and [[tab]].

[[tabview]]
[[tab Lorem ipsum]]
Lorem ipsum dolor sit amet...
[[/tab]]
[[tab You Tube rocks]]
...
[[/tab]]
[[tab Flickr rocks too!!!]]
...
[[/tab]]
[[/tabview]]

view source — view the whole source

In action

And here is what you can expect:

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim. Suspendisse id velit vitae ligula volutpat condimentum. Aliquam erat volutpat. Sed quis velit. Nulla facilisi. Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer. Sed aliquam, nunc eget euismod ullamcorper, lectus nunc ullamcorper orci, fermentum bibendum enim nibh eget ipsum. Donec porttitor ligula eu dolor. Maecenas vitae nulla consequat libero cursus venenatis.

Css Code for red tabs.

insert this into your custom theme

example http://quake.wikidot.com/

/* TABS */

.yui-navset .yui-nav a,
.yui-navset .yui-navset-top .yui-nav a {
    background-color:#d8d8d8;
    background-image: url(http://mavtech.pl/~quake/wikidot/images/yuitabs.png);
}

.yui-navset .yui-nav a em,
.yui-navset .yui-navset-top .yui-nav a em {
    border-color: #a3a3a3;
}

.yui-navset .yui-nav .selected a,
.yui-navset .yui-nav .selected a:focus, /* no focus effect for selected */
.yui-navset .yui-nav .selected a:hover { /* no hover effect for selected */
    background:#700 url(http://mavtech.pl/~quake/wikidot/images/yuitabs.png) repeat-x left -1400px; /* selected tab background */
    color:#fff;
}

.yui-navset .yui-nav a:hover,
.yui-navset .yui-nav a:focus {
    background:#d88 url(http://mavtech.pl/~quake/wikidot/images/yuitabs.png) repeat-x left -1300px;
}

.yui-navset .yui-nav,
.yui-navset .yui-navset-top .yui-nav {
    border-color: #444;
}

Rate this solution

If you think this solution is useful — rate it up! Or dump it otherwise.

rating: +59+x

Comments

CSS styles for the tab view?
pieterhpieterh 1191954221|%e %b %Y, %H:%M %Z|agohover

Can the colors be modified via CSS?

unfold CSS styles for the tab view? by pieterhpieterh, 1191954221|%e %b %Y, %H:%M %Z|agohover
Re: CSS styles for the tab view?
gerdamigerdami 1192054191|%e %b %Y, %H:%M %Z|agohover

Red tabs here : http://quake.wikidot.com/

unfold Re: CSS styles for the tab view? by gerdamigerdami, 1192054191|%e %b %Y, %H:%M %Z|agohover
Re: CSS styles for the tab view?
charleycharley 1195194359|%e %b %Y, %H:%M %Z|agohover

test 

unfold Re: CSS styles for the tab view? by charleycharley, 1195194359|%e %b %Y, %H:%M %Z|agohover
ZidarZidar 1192105421|%e %b %Y, %H:%M %Z|agohover

Can you give an example? If it is possible?

last edited on 1192105660|%e %b %Y, %H:%M %Z|agohover by Zidar + show more
unfold by ZidarZidar, 1192105421|%e %b %Y, %H:%M %Z|agohover
Re:
michal frackowiakmichal frackowiak 1192779327|%e %b %Y, %H:%M %Z|agohover

Hmmm.. probably we will change the default color to something more neutral… like gray? Blue is indeed too much outstanding.

We will post info on how to change colors later. Yes, this can be done via CSS.

last edited on 1192781259|%e %b %Y, %H:%M %Z|agohover by michal frackowiak + show more
unfold Re: by michal frackowiakmichal frackowiak, 1192779327|%e %b %Y, %H:%M %Z|agohover
Tab View: Width
WhiteKnight82WhiteKnight82 1193793190|%e %b %Y, %H:%M %Z|agohover

I have found a wonderful use for tabs.. the embedding of YouTube media.. on separate tabs on a single page.. to keep things efficient.. all i need now is a way of making the tab view width match the total width of the content with a % value… can this be done?

unfold Tab View: Width by WhiteKnight82WhiteKnight82, 1193793190|%e %b %Y, %H:%M %Z|agohover
Width and Div
SWSSWS 1194034073|%e %b %Y, %H:%M %Z|agohover

Great addition! Thank-you. I tried (without success) to get "div" (for vertical spacing) working within a tab - any suggestions?(scratch that, typo on my part) Also (as above) would like the width of the entire tab structure constrained so a floating image can be to the right of it. Will try to figure it out but just in case one of you brainiacs already did…

last edited on 1194034621|%e %b %Y, %H:%M %Z|agohover by SWS + show more
unfold Width and Div by SWSSWS, 1194034073|%e %b %Y, %H:%M %Z|agohover
Re: Width and Div
scottplanscottplan 1196654275|%e %b %Y, %H:%M %Z|agohover

The tabs are a great feature. They look good in my IE7 browser, but a friend sent me this screenshot from her Mac:

screenshot69.jpg

There's an image at the right, and the tab text respects it. The tab field spreads over it though.

As a stopgap, I've put the whole tab module into its own "div" with a fixed width. The photo frame is also a fixed width, so it would be good to have the width of the tab field adjust according to the width of the browser window.

Am I missing something? How do I get the tab field width to adjust the same way text would?

S.

unfold Re: Width and Div by scottplanscottplan, 1196654275|%e %b %Y, %H:%M %Z|agohover
edit section
Jeffrey SmithJeffrey Smith 1195144592|%e %b %Y, %H:%M %Z|agohover

I really like the tabs. I am putting the "comments" module on a separate tab to unclutter the space. One negative then is that the "edit sections" doesn't seem to work.

unfold edit section by Jeffrey SmithJeffrey Smith, 1195144592|%e %b %Y, %H:%M %Z|agohover
KillerSpazKillerSpaz 1198170621|%e %b %Y, %H:%M %Z|agohover

How would you jump from tab to tab via links?

I have a tab for reference material and would like my other tabs to have information that link to this reference material sheet.

Also, does this support multiple rows of tabs or will it all be inline?

unfold by KillerSpazKillerSpaz, 1198170621|%e %b %Y, %H:%M %Z|agohover
Re:
KillerSpazKillerSpaz 1198182224|%e %b %Y, %H:%M %Z|agohover

OK I found it DOES support multiple levels of tabs, but still trying to find out if it's possible to have a link jump to a specific tab..

unfold Re: by KillerSpazKillerSpaz, 1198182224|%e %b %Y, %H:%M %Z|agohover
Re: linking to content in a specific tab
David DrascicDavid Drascic 1210820195|%e %b %Y, %H:%M %Z|agohover

The tabs currently work with CSS only, without any JS scripting.

In its most basic terms, each tab is a floating <DIV> that is hidden, UNTIL the user clicks on that tab's label and thus gives it "focus". The .yui-navset CSS for a selected DIV specifies that it is visible, which is why it pops to the front.

Unforunately, you cannot set the focus on a hidden div just following an link to an anchor contained inside. Doing this requires some javascript to "select" the correct tab, which is currently beyond the scope of the current wikidot software, I think.

unfold Re: linking to content in a specific tab by David DrascicDavid Drascic, 1210820195|%e %b %Y, %H:%M %Z|agohover
Re:
BrightMornBrightMorn 1210994631|%e %b %Y, %H:%M %Z|agohover

How did you get it to work with multiple levels? Basically I want three tabs, with a new set of 3 tabs inside of each one. When I try and do this I get the wrong tabs in each set. Ideas?

unfold Re: by BrightMornBrightMorn, 1210994631|%e %b %Y, %H:%M %Z|agohover
Re:
ljkloftljkloft 1215698039|%e %b %Y, %H:%M %Z|agohover

Recently, one of my wikidoters on one of my wikis used a multiple level tab system and included a [[module SimpleToDo id="mylist1"]]. All the coding for the multiple layers of tabs is correct
In Internet Explorer the page reports the following error: Internet Explorer cannot open the Internet site http://ec720.wikidot.com/cindy-l-hill. Operation aborted.

The page is dead in Internet Explorer v7. First thought, the tab coding or To Do List coding had an error. Did an archive backup of the wiki and pulled the offending page. Code is clean.

Next thought, was it the browser not meeting standards. Opened the page in Firefox v3 and the page works correctly.

Has anyone had experience with Internet Explorer incompatibilities on wikidot?

Len

unfold Re: by ljkloftljkloft, 1215698039|%e %b %Y, %H:%M %Z|agohover
@@ [[toc]] @@
(bkl)(bkl) 1200998778|%e %b %Y, %H:%M %Z|agohover

is it possible to use the [[toc]] command only regilnally inside a single tab?

unfold @@ [[toc]] @@ by (bkl)(bkl), 1200998778|%e %b %Y, %H:%M %Z|agohover
Print
ToomoreToomore 1203013407|%e %b %Y, %H:%M %Z|agohover

I want to print the page but it only display the first tab.
How to list all tabs content for print?
Thanks.

last edited on 1203013486|%e %b %Y, %H:%M %Z|agohover by Toomore + show more
unfold Print by ToomoreToomore, 1203013407|%e %b %Y, %H:%M %Z|agohover
Italics
ScrapHeapScrapHeap 1205958949|%e %b %Y, %H:%M %Z|agohover

Is there a way to get italic text within tabs?

unfold Italics by ScrapHeapScrapHeap, 1205958949|%e %b %Y, %H:%M %Z|agohover
Editing the tab colour by customising yuitabs.png
David DrascicDavid Drascic 1209436864|%e %b %Y, %H:%M %Z|agohover

As you will notice by looking through the Wikidot Standard Theme CSS, you will find that the background image for the tabs is taken from the file sprite.png. That's how they get that nice graduated colour blend. If you create your own version of that file, you can modify the colours of the relevant sections using whatever graphics editor you like. (I used "PhotoFiltre" which is a terrific small and free graphics editor with great capabilities, esp for the price).

You will then need to upload your own custom version of the sprite.png file, and then create a custom CSS theme where you redefine all of the relevant .yui-navset classes to point to your own graphic:

Original code snippet from standard wikidot theme:

.yui-navset .yui-nav a,
.yui-navset .yui-navset-top .yui-nav a {
    background:#d8d8d8 url(/common--javascript/yahooui/assets/sprite.png) repeat-x; /* tab background */
    border:solid #a3a3a3;
    border-width:0 1px;
    color:#000;
    position:relative;
    text-decoration:none;
}

.yui-navset .yui-nav .selected a,
.yui-navset .yui-nav .selected a:focus, /* no focus effect for selected */
.yui-navset .yui-nav .selected a:hover { /* no hover effect for selected */
    background:#2647a0 url(/common--javascript/yahooui/assets/sprite.png) repeat-x left -1400px; /* selected tab background */
    color:#fff;
}

.yui-navset .yui-nav a:hover,
.yui-navset .yui-nav a:focus {
    background:#bfdaff url(/common--javascript/yahooui/assets/sprite.png) repeat-x left -1300px; /* selected tab background */
    outline:0;
}

Your custom CSS code:

.yui-navset .yui-nav a,
.yui-navset .yui-navset-top .yui-nav a {
    background:#d8d8d8 url(http://mysite.wikidot.com/local--files/home/sprite.png) repeat-x; /* tab background */
}

.yui-navset .yui-nav .selected a,
.yui-navset .yui-nav .selected a:focus, /* no focus effect for selected */
.yui-navset .yui-nav .selected a:hover { /* no hover effect for selected */
    background:#2647a0 url(http://mysite.wikidot.com/local--files/home/sprite.png) repeat-x left -1400px; /* selected tab background */
}

.yui-navset .yui-nav a:hover,
.yui-navset .yui-nav a:focus {
    background:#bfdaff url(http://mysite.wikidot.com/local--files/home/sprite.png) repeat-x left -1300px; /* selected tab background */
}

NOTE that you only need to redefine the relevant properties for each class, since it automatically inherits the rest of the properties from the default theme.

last edited on 1210821834|%e %b %Y, %H:%M %Z|agohover by David Drascic + show more
unfold Editing the tab colour by customising yuitabs.png by David DrascicDavid Drascic, 1209436864|%e %b %Y, %H:%M %Z|agohover
How do I get tabs to work in the side-bar?
JNMay87JNMay87 1211141191|%e %b %Y, %H:%M %Z|agohover

I wanted to have the sidebar on my wiki in both Spanish and English using tabs, but they don't work on the side-bar. Any ideas as to how to fix this?

unfold How do I get tabs to work in the side-bar? by JNMay87JNMay87, 1211141191|%e %b %Y, %H:%M %Z|agohover
Re: How do I get tabs to work in the side-bar?
Vincent CharetteVincent Charette 1211339831|%e %b %Y, %H:%M %Z|agohover

I speak French and English and I decided to make a bilingual site. So to get both languages in the side-bar, I used a foldable list and I got an effect that is similar to the one you get from the site manager page.

Here is the what I did. If you follow the same structure, you should get text that fold under
English. You should also change the page links as your pages may not have the same name as mine, and you can change Français to Spanish, and all the page links that are under that list.

Basically, follow this structure.

Hope this helps, I know it is not tabs in the side-bar, but I think that it will do what you want.

unfold Re: How do I get tabs to work in the side-bar? by Vincent CharetteVincent Charette, 1211339831|%e %b %Y, %H:%M %Z|agohover
Re: How do I get tabs to work in the side-bar?
Vincent CharetteVincent Charette 1211340258|%e %b %Y, %H:%M %Z|agohover

[[div class="foldable-list-container"]]
* [# Français]
* [[[français:bienvenue | Page de bienvenue]]]
* [[[français:questcequunwiki| Qu'est ce qu'un Wiki?]]]
* [[[français:commentmodifierlespages? | Comment modifier les pages?]]]
* [[[system:members | Membres du site]]]
* [[[system:page-tags-list| Étiquettes]]]
* [[[admin:manage|Maître du site]]]
[[/div]]

I could not get the indent to show in this version, sorry. I forgot to show the code in the previous post.

unfold Re: How do I get tabs to work in the side-bar? by Vincent CharetteVincent Charette, 1211340258|%e %b %Y, %H:%M %Z|agohover
More tabs in side bar info please
bld213bld213 1211556288|%e %b %Y, %H:%M %Z|agohover

I'd also like to know if it is possible to use the tabbed structure in the side bar - they just come out flat when I try.

I had a foldable list as suggested, but the tabs would be so much better and it more with the way other stuff is arranged in the main pages.

last edited on 1211556312|%e %b %Y, %H:%M %Z|agohover by bld213 + show more
unfold More tabs in side bar info please by bld213bld213, 1211556288|%e %b %Y, %H:%M %Z|agohover
:)
EscuraEscura 1213782903|%e %b %Y, %H:%M %Z|agohover

Thanks this is really useful

unfold :) by EscuraEscura, 1213782903|%e %b %Y, %H:%M %Z|agohover
bug
NorthNorth 1216132227|%e %b %Y, %H:%M %Z|agohover

There is a bug with the tabs. For the mods there is a hidden link in my message to the page that contains the error. The tab in the second post do not switch.

link here:

last edited on 1216132993|%e %b %Y, %H:%M %Z|agohover by North + show more
unfold bug by NorthNorth, 1216132227|%e %b %Y, %H:%M %Z|agohover
Re: bug
JadianJadian 1216901879|%e %b %Y, %H:%M %Z|agohover

I came from the same site, so I've taken a look at it myself. The issue with it is in how the id for the div elements is generated. I haven't tested it extensively and not sure I'm experienced enough for a good read-through of the code, but…

In seperate posts, the div id starts at the initial count, "wiki-tabview-0", which is generating an error across several posts. Both posts are were generated and saved seperately, so they can't account for the existance of tabviews that occured in previous posts. I don't know if this is something that could logically be fixed without some extensve coding or rather dynamic naming, though.

This might also be related in part to the fact that placing one tabview inside another doesn't work, but I haven't looked at it regarding that yet.

unfold Re: bug by JadianJadian, 1216901879|%e %b %Y, %H:%M %Z|agohover
Add a new comment
page tags: layout tab tabs tabview
page_revision: 5, last_edited: 1205830660|%e %b %Y, %H:%M %Z (%O ago)
Unless stated otherwise Content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License