~~~ Please read before posting. ~~~

Important: We need your Club Number at a minimum, and as many details as possible.
For further info please read This page before posting.

How to put tabs in your content.

  • SteveTheTechie
  • SteveTheTechie's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Posts: 11526
  • Thanks: 3050

How to put tabs in your content.

11 years 4 months ago - 10 years 10 months ago
#35831
(Revised 11/29/2014 for FTH 2.20)
We use the jQuery code library for FreeToastHost, but in reality any club can make use of some of its features.

Here is how to set up real, functioning tabs on your home page, meeting info page, or custom page:

First of all copy the following to the clipboard to use as a template for your tabs...
Code:
<div id="myTabs" class="userTabs"> <ul class="tab-list"> <li><a href="#tab1">My First Tab</a></li> <li><a href="#tab2">My Second Tab</a></li> <li><a href="#tab3">My Third Tab</a></li> </ul> <div id="tab1"> This is some content. </div> <div id="tab2"> This is some more content. </div> <div id="tab3"> This is even more content. </div> </div>

Please copy the above to an empty custom web page in Source View, then you can test it out until you get it working the way you want. The above is set up for 3 tabs.

There are three parts to this... (must be created in Source View for best results)
1. An overall enclosing <div> block. Use the "userTabs" class as indicated to make FTH automatically convert this to tabs--FTH does the script part, then. You can have an id specified (e.g. like "myTabs"), but it is optional. (If you use an id then put your club number on end to make sure you do not clash with FTH ids.) Including script text is no longer necessary. FTH will handle setting this up as long as you correctly use the "userTabs" class name.

2. A ul block. (unordered list) Use the class="tab-list" piece for rounded tabs like in FTH2. Each li line in the ul block represents one tab.... one li line per tab. The hrefs in the <a tags in each li line must match a corresponding id in one of the inner div blocks.

3. Inner div blocks containing the actual content for each tab. This content can be anything even pictures. The ids of these inner div blocks must match the li lines in the ul block.

Again, no JavaScript is needed for this if you use the "userTabs" class name as indicated above. This is an FTH 2.20 advanced feature.

Do not use the same tab IDs as I used above--make up your own and append your club number them to make them distinct from those used in FTH. (otherwise you can create problems) Make sure you pay close attention to where the "#" signs go. That is what I goof up on most frequently with tabs.

If you view the above in normal editor view, you will see a bulleted list and your tab content. (It helps to toggle on the block indicators in ckeditor in normal view.) You have to save your page and exit the Admin Console to see the actual tabs.

Enjoy! Please share your webpage address on here so that we can admire your work!
Last edit: 10 years 10 months ago by SteveTheTechie.
The topic has been locked.
  • SteveTheTechie
  • SteveTheTechie's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Posts: 11526
  • Thanks: 3050

Re: How to put tabs in your content.

11 years 4 months ago
#35833
If anyone wants me to post on setting up an accordion I can do that also.
The following user(s) said Thank You: AnitaCCC
The topic has been locked.
  • morrowcoteacher
  • morrowcoteacher's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 158
  • Thanks: 36

Re: How to put tabs in your content.

11 years 2 months ago
#36707
I'm not doing something right

my tabs show up but they won't link to where I want them to go

and then I keep getting a list below the tabs... all I want are the tabs and of course for them to work.

here is the code I put in:

<div id="154mytabs">
<ul>
<li><a href="#154tab1">NEWSLETTERS</a></li>
<li><a href="#154tab2">CONFERENCES</a></li>
<li><a href="#154tab3">DISTRICT 9</a></li>
</ul>

<div id="154tab1"> <a href=" 154.toastmastersclubs.org/club_154_Newsletters.html ">NEWSLETTERS


<div id="154ab2"> <a href=" 154.toastmastersclubs.org/CONFERENCES.html ">CONFERENCES


<div id="154tab3">  <a href=" tmd9.org ">DISTRICT 9

</div>
<script>jQuery("#154mytabs").tabs()</script>



thanks

Darlene Marquardt, vppr
154.toastmastersclubs.org
The topic has been locked.
  • SteveTheTechie
  • SteveTheTechie's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Posts: 11526
  • Thanks: 3050

Re: How to put tabs in your content.

11 years 2 months ago - 11 years 2 months ago
#36708
Ok, the thing is that you are trying to do this a bit differently than tabs are usually used for.

It looks like you are trying to use the tabs as a sort of menu, rather than just content separators/bookmarks, which is actually how they are intended to be used. Thus, the divs at the bottom usually contain the actual content to be divided up rather than links to the content.

The other thing is that the following appears to be misspelled: <div id="154ab2">

Tabs are very picky... they won't work with misspellings. I get tripped up with them all the time.

Also, I am going to edit my original post to show my class name for rounded tabs... so take another look in a few minutes.
Last edit: 11 years 2 months ago by SteveTheTechie.
The topic has been locked.
  • AnitaCCC
  • AnitaCCC's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thanks: 2

Re: How to put tabs in your content.

10 years 10 months ago
#41987
I saw this on a Club's website used for their meeting minutes. They had the last 6 years of meeting minutes! :ohmy:

No more emailing or photocopying meeting minutes! All the club secretaries should know about this!
:cheer:
The topic has been locked.
  • SteveTheTechie
  • SteveTheTechie's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Posts: 11526
  • Thanks: 3050

Re: How to put tabs in your content.

10 years 10 months ago
#41991
Thanks, In FTH 2.20, I have made this even easier, since I am now handling the script part for users.

I have edited the above to add the class name userTabs, and remove the script tags, since they are no longer needed.

The FTH 2.20 will automatically convert any HTML section with the userTabs class to jQuery UI tabs.

There is also the analogous with userAccordion and userMenu classes.
The topic has been locked.
Moderators: BrianPamrhtaylor3marc33NotLiablejgavinLcala305Henipeterb323DebbieT
Time to create page: 0.790 seconds
Powered by Kunena Forum