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
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | source.txt | 216.41 KB | gmak |
Comments
Comment #1
merlinofchaos commentedHm. 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.
Comment #2
gmak commentedIt 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
Comment #3
nielsvoo commentedI 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
Comment #4
gmak commentedNielsvoo,
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
Comment #5
gmak commentedOK, 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
Comment #6
nielsvoo commentedDear 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
Comment #7
gmak commentedThis 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:
I can't see any usable ID that would allow me to target this tab.
Any ideas?
Comment #8
nielsvoo commentedPlease post a link to a page on your site where the tabs are...
Comment #9
gmak commentedHere you go:
http://www.bim-gateway.com/node/29377
Thanks for your help.
Comment #10
nielsvoo commentedOK 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
Comment #11
gmak commentedNielsvoo,
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
Comment #12
nielsvoo commentedoke 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...
Comment #14
nimayshah commented@gmak, were you ever able to solve this issue? I have the exact same issue with vertical tabs!