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

Comments

nedjo’s picture

Not sure. This may be a bug in this module if it isn't respecting field weight.

tower_of_flower’s picture

To 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.)

tower_of_flower’s picture

I 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.

nedjo’s picture

Status: Active » Needs review
StatusFileSize
new2.48 KB

Here'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.

tower_of_flower’s picture

Currently 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

tower_of_flower’s picture

Just noticed something, it seems that it is the link that is wrong, the tabs just link to "#-".

nedjo’s picture

Had a look at the link you pointed to but I don't spot the problem. Is something missing from the page?

tower_of_flower’s picture

Yeah, I should have stopped I got it working, hence the page working ok. Not made patches before so just figuring that out!

Cheers.

tower_of_flower’s picture

Status: Needs work » Needs review

Here you go this seems to get the problem solved. This includes Nedjo's patch.

Edit: Removed bad patch

Darrin Breen’s picture

Hello there - I'm having the same problem. Is the patch the "offical" method to fix this? It's ready to go - safe to use?

nedjo’s picture

Status: Needs review » Needs work

The 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.

Darrin Breen’s picture

I 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?

nedjo’s picture

Darrin Breen’s picture

Hi nedjo - I'm getting even more confused - would it be OK if I emailed you?

Darrin Breen’s picture

So 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.

jmary’s picture

Should we apply the 2 patches or only the last one ? (I'm confuse with message #9)

tower_of_flower’s picture

Here 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

tower_of_flower’s picture

StatusFileSize
new883 bytes

This patch should be applied after Nedjo's original patch. It fixes the links.

Please ignore my previous patch.

tower_of_flower’s picture

Please test the above patch.

tower_of_flower’s picture

I have now patched the site at the given URL, so the issue with Nedjo's patch will no longer be present.

headkit’s picture

seems to work now, your tabs on your link.
how did you manage this?

vacilando’s picture

Status: Needs review » Reviewed & tested by the community

Had 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.

bgm’s picture

I ran into the same bug described above (field weights not respected in node display) and applying the two patches fixed the problem.

Harpreet Singh’s picture

I'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 ?

nedjo’s picture

Status: Reviewed & tested by the community » Fixed

Applied.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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