Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

tabstrip problem - inactive tabs


Go to End


2 Posts   2143 Views

Avatar
le_banana

Community Member, 21 Posts

20 February 2009 at 12:59pm

Edited: 20/02/2009 1:03pm

Hello Everybody.
I've got a little problem with tabstrip in cms, in my new module (which is php file, based of already generated CMS's code). I know, that i need something like that:

<ul class="tabstrip">
<li><a href="customising-the-cms/newModule.php#something">something</a></li>
<li><a href="customising-the-cms/newModule.php#other">other</a></li>
</ul>

<div id="something">
the content of 1 tab
</div>

<div id="other">
the content of the other tab
</div>
I observed in firebug, how styles are changing , i mean:
in <ul> with class "tabstrip" , the active <li> have class: current
Active <div> have also class: current, and and other parametr is: style="display: block;"
Inactive <div> have style="display: none;"
My problem is, when I open my new module in CMS, both of my tabs are inactive. I tried to set stiff parameters for one tab, like class="tab current" and style="display: block;" , but when whole page is loaded, only <li> is still active, but both of tabs are not (styles are again set to "display: none;" )
Is there any possibility to run some kind of function from tabstrip.js file, or any other at the end of my code, to avoid this situation?
Maybe exists other way to ensure, when user open this module, one of tab will be active?

Eventually, i could use an anchor in the URL address, but for me it doesn't look professionally ;-)

If somebody could help me, i would be greatfull.
Peace.

Avatar
le_banana

Community Member, 21 Posts

21 February 2009 at 11:42am

My problem was solved .

There was "/" between "newModule.php" and "#something" :)