Hi,
I am trying to position the tabs at the bottom of a node by changing the weighting of the field groups. Should this work or must another approach be taken?
All other fields move around as expected.
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | fieldgroup_tabs_fixed_weight.patch | 883 bytes | tower_of_flower |
| #4 | cck_fieldgroup_tabs-weight.patch | 2.48 KB | nedjo |
Comments
Comment #1
nedjoNot sure. This may be a bug in this module if it isn't respecting field weight.
Comment #2
tower_of_flower commentedTo provide some more details -
The body field is obviously set a weighting of 0
The two field groups are assigned a weight of 9 and 10
Each of the fields within the field group also have a weighting of >0. (Though I would think that this has no effect on where the tabs are placed in the node.)
Comment #3
tower_of_flower commentedI found the problem, $node->content['fieldgroup_tabs']['#weight'] must be set to allow you to position the tabs correctly.
I added a simple bit of code to calculate the average of all the fieldgroup weights, and this sets the weight of the tabs.
Comment #4
nedjoHere's a patch that sets the tabset weight to that of the lowest fieldset it includes, both for form and for node display.
Review would be appreciated.
Comment #5
tower_of_flower commentedCurrently that seems to stop it from displaying the content that is within any other tab. Haven't looked at the actual code, though.
Will do now...
Here is an example though: http://audient.myzen.co.uk/audient/node/9
Comment #6
tower_of_flower commentedJust noticed something, it seems that it is the link that is wrong, the tabs just link to "#-".
Comment #7
nedjoHad a look at the link you pointed to but I don't spot the problem. Is something missing from the page?
Comment #8
tower_of_flower commentedYeah, I should have stopped I got it working, hence the page working ok. Not made patches before so just figuring that out!
Cheers.
Comment #9
tower_of_flower commentedHere you go this seems to get the problem solved. This includes Nedjo's patch.
Edit: Removed bad patch
Comment #10
Darrin Breen commentedHello there - I'm having the same problem. Is the patch the "offical" method to fix this? It's ready to go - safe to use?
Comment #11
nedjoThe second patch handles only the form display, while we need a solution that handles both form and node display, as I did in the first patch.
If there is a problem with my first patch, please specify it.
Comment #12
Darrin Breen commentedI not 100% sure how to apply the patch - still figuring quite a few things out... do I overwrite a bit of code in the module file?
Comment #13
nedjoSee http://drupal.org/patch/apply
Comment #14
Darrin Breen commentedHi nedjo - I'm getting even more confused - would it be OK if I emailed you?
Comment #15
Darrin Breen commentedSo I'm sure I did this the entirely wrong way... but when those instructions started talking about looking at things on a command line I get scared... so I just copied the line out of the second patch that was different and pasted it in - this line: $element['#weight'] = $group['weight'];
Seems to work fine now - my tabs are on the bottom of the node as I wanted. Should I not apply the "patch" this way? copying and pasting (in my case via text wrangler). In any case - so far so good. I hope this is of some help to you... even if I did it wrong.
Comment #16
jmary commentedShould we apply the 2 patches or only the last one ? (I'm confuse with message #9)
Comment #17
tower_of_flower commentedHere is an example of the problem with Nedjo's patch.
http://audient.myzen.co.uk/audient/node/45
Switching between the tabs doesn't work correctly (look at the url). My patch fixes this problem, but the weighting is not working correctly in the form view. I'll look into this.
Sorry for the confusion caused.
TOF
Comment #18
tower_of_flower commentedThis patch should be applied after Nedjo's original patch. It fixes the links.
Please ignore my previous patch.
Comment #19
tower_of_flower commentedPlease test the above patch.
Comment #20
tower_of_flower commentedI have now patched the site at the given URL, so the issue with Nedjo's patch will no longer be present.
Comment #21
headkit commentedseems to work now, your tabs on your link.
how did you manage this?
Comment #22
vacilando commentedHad the same problem now, and fixed it using the two patches. Would be lovely if you could make a new release so that all users can benefit. Thanks.
Comment #23
bgm commentedI ran into the same bug described above (field weights not respected in node display) and applying the two patches fixed the problem.
Comment #24
Harpreet Singh commentedI'm using Drupal 5.7 with JSTools 5.x-0.8 and have applied the two patches above. But this is still not working.
The Tabs are not shown when displaying a node. If I deactivate the property display:none in drupal-tabs.css, then the tabs are shown. But still cant flip between another tabs.
The links to the tabs are something "#-" ??? no numbers ! nothing
what to do ?
Comment #25
nedjoApplied.
Comment #26
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.