Hi,

I have a number of Views Panes defined as Vertical Tabs. I am wondering whether it is possible to jump directly to a specific tag via URL. I'd like to be able to have a user looking at one content type, click link that says "see more like this" and jump to the corresponding tab.

Is it possible?

Thanks

CommentFileSizeAuthor
#7 source.txt216.41 KBgmak

Comments

merlinofchaos’s picture

Status: Active » Fixed

Hm. That would be up to the vertical tabs code. Typically the tabs systems use a URL fragment that controls the tab, but I haven't looked into vertical tabs so I can't say for sure. I would analyze the actual URLs in the clicks for the tabs; if they contain fragments you might be able to use that to open a page to a specific tab.

There isn't really much Panels itself could do about this, that's up to the tabs code.

gmak’s picture

It looks like it is doing everything via Javascript. The URL is simply <a href="#">

So unless someone can come up with a clever way of doing things, I think I'm stuck (at least with my level of coding skill).

Thanks

nielsvoo’s picture

I figured it out, sometimes the things you are looking for are actually quite simple. When i opened the source of the page containing the vertical tabs i noticed that the tab has an ID generated by Drupal 7, this is the one needed to point to your favorite tab.

For example your tab group name is group_mytab then your link should be:
http://www.yourdomain.com/yourpage/edit#edit-group_mytab

Niels

gmak’s picture

Nielsvoo,

That only seems to be for tabs on the edit page, not for a content view page with vertical tabs.

Can anyone point me to the vertical tabs code where the <a href="#"> is generated for the tab? I can't seem to find it.

I am wondering whether I can get the Tab Title to be appended to the "#" which would then allow me to jump to a specific tab.

Thanks

gmak’s picture

OK, you can all ignore my previous post, as I found misc/vertical_tabs_js.inc. But, from what I can see (and having done some more digging on D.O.), the code in there should allow you to activate a tab via URL fragment. However, it looks like Panels is not generating the URL fragment (if it is Panels that does this).

I can't see where the URL fragment (<a href="#">) is being created.

Can anyone help me find this and/or point out how I might get the Tab Title appended?

Thanks

nielsvoo’s picture

Dear gmak,

also for normal links this should work.

i will guide you..

- Go to the page where the tab is
- Click right mouse and choose show source
- Search in the source to find the name of the tab
- Now see if there is an id="THIS_IS_YOUR_ID"
- Copy the id and paste it in notepad
- Now copy the URL from the page where the tab is and paste in notepad also
- Now combine those using a # in between

this should be:

the url + # + the ID..

Succes
Niels

gmak’s picture

StatusFileSize
new216.41 KB

This is all getting a bit strange. When I 'view source' for the page, I don't see anything that refers to the tabs (see the attached html output). However, when I do "Inspect Element" in Google Chrome, I see:

<li class="vertical-tab-button selected" tabindex="-1">
<a href="#">
<strong>Floor</strong>
<span class="summary">
</span><span id="active-vertical-tab" class="offscreen">(active tab)</span>
</a>
</li>

I can't see any usable ID that would allow me to target this tab.

Any ideas?

nielsvoo’s picture

Please post a link to a page on your site where the tabs are...

gmak’s picture

Here you go:

http://www.bim-gateway.com/node/29377

Thanks for your help.

nielsvoo’s picture

OK Gmak,

i noticed also, there is no id in your output code. Is there a possibility for you to see what's the computer name of a tab in the back end?

maybe this could work also by adding this behind the url: http://www.bim-gateway.com/node/29377#(YOURID)

Otherwise maybe this is something you could try: http://mysitemyway.com/support/topic/can-i-link-to-a-vertical-tab-from-a...

Niels

gmak’s picture

Nielsvoo,

I'd be happy to provide you with the "computer name of a tab in the back end", if you can give me a clue as to how to do this.

Many thanks

nielsvoo’s picture

oke your tabs are configured in views mine in cck fields on a content type so there could be a difference, although you must have set somewhere your tab names, on this screen i think you could see also the computer name, the one without spaces...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nimayshah’s picture

Issue summary: View changes

@gmak, were you ever able to solve this issue? I have the exact same issue with vertical tabs!