Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be great if direct links to a fieldgroup are possible.
at the moment a link to www.example.com/node/11/edit#some_tab brings you to the edit form but the javascript is not processed and all fieldgroups are shown as fieldgroups.
desired is the edit form with the tab opened.
Comment | File | Size | Author |
---|---|---|---|
#15 | verticaltabs-anchor.patch | 974 bytes | casey |
#13 | verticaltabsactive.patch | 875 bytes | moshe weitzman |
#9 | fragment-D6.patch | 1.31 KB | seancorrales |
#6 | verticaltabsactive.patch | 875 bytes | casey |
#5 | 376293-fragment-D6.patch | 1.39 KB | Dave Reid |
Comments
Comment #1
jenlamptonI'm pretty sure this is a bug and not a feature request.
I could be wrong, but it seems fairly important.
Jen
Comment #2
mErilainen CreditAttribution: mErilainen commented+1 for this
It comes in handy when inserting links to profile fields saying "You haven't added you birthday yet. Add it here"
Comment #3
ptoly CreditAttribution: ptoly commented+ 1
bump
Comment #4
Dave ReidMinor annoyance, but this is a feature request. Patches welcome. :)
Comment #5
Dave ReidHere's the patch for the D6 module, but I'd like to see this fixed in D7 as well.
Comment #6
casey CreditAttribution: casey commentedPatch for D7
Comment #7
moshe weitzman CreditAttribution: moshe weitzman commentedThis looks good. One caveat is that there is already some code to keep you on the same tab when you submit a form. and that should continue to work. so, if i get sent to a tabbed page with #some_tab and then i open up #other_tab and submit the form, i want #other_tab to stay open.
Comment #8
casey CreditAttribution: casey commentedWon't you lose the URL fragment when you submit a form (with node edit form you do)? In that case it'll re-activate the tab you had active before.
I moved this check before the hidden input (.vertical-tabs-active-tab) as it seems that that input is always present in node edit forms.
Comment #9
seancorrales CreditAttribution: seancorrales commentedTried #5 and it worked but one small problem - the right pane was selected but none of the content was shown.
Re-rolled a patch and fixed the issue by changing around the order some - I put the hide statement for all the panes first and then put the code in for the fragment piece. Only tested on the node edit form using Vertical Tabs 6.x-1.0-rc1.
Comment #10
Saeh CreditAttribution: Saeh commentedin this included in drupal 6? or do i still need to patch the latest release to get it to work
Comment #11
restyler CreditAttribution: restyler commentedIs there a way to remember the last opened vtab, based on hash, after form submit, in 6.x?
Comment #12
aspilicious CreditAttribution: aspilicious commentedLets fix this first in D7...
Comment #13
moshe weitzman CreditAttribution: moshe weitzman commentedRe-upload last d7 patch - #6
Comment #15
casey CreditAttribution: casey commentedComment #16
moshe weitzman CreditAttribution: moshe weitzman commentedthis will do nicely. thanks.
Comment #17
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #18
Dave ReidMoving to backport to D6, and then I will move this back to the Drupal queue once backported.
Comment #19
g.k CreditAttribution: g.k commentedI applied #9 fragment-D6.patch for my D6 installation and it works fine if the URL (with anchor) was called from a different page, but it doesn't switch tabs if the tab is on the same page. Also, it would be nice UI experience if the page scroll down automatically and highlight the active tab.
Comment #20
dmitrig01 CreditAttribution: dmitrig01 commentedIf that worked as you described then it doesn't need a port.
Comment #21
dmitrig01 CreditAttribution: dmitrig01 commentedIf that worked as you described then it doesn't need a port.
Comment #22
jasonlttl CreditAttribution: jasonlttl commentedIt would be nice if the d6 patch in #9 could be committed. I just tested it on one of our d6 sites, and it seemed to work fine with the caveat (#19) that, on the node edit form, hand crafted links don't work unless you do something special.
I think the code in #9 only handles initial page load and that the vertical tabs way is to have the initiating link trigger the action. For example, in vt code, it does something like this.
If you want to make custom links drive vertical tabs from the same page, putting something like this in the onclick handler works (although you wouldn't want it on an external page). I'm guessing this is probably not something one would want vertical tabs to do automatically.
Comment #23
robcarrI think patch at #9 is fine for Drupal 6. Just tried it and works fine. Could someone commit??
Comment #24
lefnire CreditAttribution: lefnire commented#9 needs a re-roll for rc2
update: woops, never mind me -- works against the -dev
Comment #25
JamesK CreditAttribution: JamesK commentedsubscribe
Comment #26
grasmash CreditAttribution: grasmash commentedyes, it would be great to get this committed. very useful.
Comment #27
firestonej CreditAttribution: firestonej commentedI see that this has been implemented, but it doesn't work with vertical or horizontal tabs.
I must be missing something, because it seems like this line:
if (window.location.hash && $(window.location.hash, this).length) {
Will never select anything with the second statement. The fieldgroups aren't generated with any IDs. If I manually edit that selector to target something else, or alter the markup myself, I can get this to work. However, it's definitely not functioning by itself.
D7.9, FieldGroups 1.1 .. running on IIS, if it matters.
Comment #28
firestonej CreditAttribution: firestonej commentedOkay, cancel that. I finally figured out what it's attempting to target.
I was under the impression it was looking for a reasonably formed ID / the name of the tab. Now I see it's looking for a mangled, non-restful underscore nightmare. I'm probably on my own from here, but it seems like those tab IDs should be the names that you assign in the content type admin..
Comment #29
El Bandito CreditAttribution: El Bandito commentedHi
From #19 :
Also, it would be nice UI experience if the page scroll down automatically and highlight the active tab.
Me too.
El B
Comment #30
grasmash CreditAttribution: grasmash commented@29
Here's a snippet that I used for that:
Comment #31
clutherI've been unable to implement this feature in D7 or find a working example of code. What I've tried:
DUH moment - It wasn't until I posted this comment that I noticed that this issue thread was for a Drupal 6 module and not for the vertical tabs that is part of core Drupal 7. I could not find an issue in Drupal 7 Core for this feature, so I've created a feature request here: http://drupal.org/node/1615474
At this point, other that attempting to submit a patch to D7 Core, I don't know what else I can do. Still ideas and suggestions are welcome. Thanks in advance.
Chris
Comment #32
Elijah LynnComment #33
Elijah LynnRE #31 - #15 was committed with http://cgit.drupalcode.org/drupal/commit/?id=093f99a794e0ff6107fbd052560... and you can use the name of the vertical tab as the hash, in my experience though, it is case sensitive, maybe this shouldn't be case sensitive.
Here is an example if you have a tab named 'Vertical Tab Name':
#Vertical Tab Name
#Vertical+Tab+Name
#Vertical tab name (will not work)
Comment #34
Elijah Lynn@cluther - I know this is 4 years later but I submitted a follow up issue to update the URL bar with the hash when a vertical tab is selected. This will show how to link them. We should open a new issue to make them case insensitive, since URLs in Drupal 7 are also case-insensitive.
#2752511: Update location.hash when clicking a vertical tab