Hi - first, love the module - exactly what I needed, thanks! :)
The one problem I'm having though is that I decided to create a separate template for the content type that uses the tabs. The name of this file is nod-plans-tpl.php. When I didn't find the print command easily to print the tabs I ended up hardcoding the unordered list menu inside this file. So now my code for the plans reads:
<div class="drupal-tabs">
<ul id="planspg">
<li><a href="#tabset-1">Floor Plans</a></li><li><li><a href="#tabset-2">Model A</a></li><li><a href="#tabset-3">Model B</a></li><li><a href="#tabset-4">Model C</a></li><li><a href="#tabset-5">Model D</a></li></ul>Though the page works perfectly and I like that I was able to give the list their own id for customizing the look I now notice that I lost the ability to disable tabs if their is no content in that section. If you look at the list items in the code above you'll notice that I have tabs for Models A through D. The content in these sections only contain one image.
I guess my question is what is the correct code to include the tabs in a tpl.php page so that the tabs without content disappear? Or is there an if statement that I can include in the li tag that would give a class of "tabs-disabled" if the image for the each model doesn't exist?
So far I've tried the following code but unfortunately it either gives me a parse error, disables the tab even when the corresponding content DOES exist or it does nothing.
<li class="<?php if (content_format('field_model_a_img', $field_model_a_img[0]) == '0') { echo "tabs-disabled"; }else{ echo "none"; } ?>"><a href="#tabset-2">Model A</a></li>
Any help on this is appreciated! Thanks!
Comments
Comment #1
eggthing commentedYes, I second this request. Would love to be able to use a node.tpl.php to customise bio and use cck fieldgroup tabs too.
Comment #2
eggthing commentedAny news on this?
Comment #3
mattez commented+1
Comment #4
daniel wentsch commented+1 subscribing
Unfortunately, without being able to output tabs in custom node template, I can't use them.
Comment #5
kolier commented+1
And I think you can check whether the element in the group is empty();
Comment #6
codevelopment+1
I'm looking for the same code -- it should really be documented somewhere, it's a pretty essential part of making tabs work on custom node templates.
Comment #7
Prasad Shir commentedI have same question / requirement. I need to make custom layout for a node type for which I am using CCK Field Group tabs. I tried using contemplate, node-type.tpl.php and even panels 3. For any of these options unable for find out what code or option to use to render CCK Fieldgroup tabs. Any help or pointer to a solution will be highly appreciated.
Prasad
Comment #8
hey_germano+1, subscribing
I'd like to render a specific type of node's comment form on a tab, so I'm looking for a way to put this -
<?php print comment_render($node, NULL); ?>- in a tab I create on the tpl.php. I think. But yep, having a little more control over these would be super awesome.Comment #9
ahimsauziThis is the code I use but for some reason I can't seem to make the empty tabs go away. Any suggestions?
Comment #10
ahimsauziI figured a solution. Add if statement between list elements. Like so:
Comment #11
miphol commentedHow about this?
Then you just implement theme_tabset() and theme_tabpage() to further customize the output.
Comment #12
ahimsauziThat worked very well, thanks miphol!
I must say I was having hard time theming the output of that call. What will be the best way to override the output?
I can't find the theme_tabset() function...
Comment #13
amirtaiar commentedI am trying this code on a drupal 7 node-13.tpl.php I have created and the tabs are link to nothing.
I want them to link to a cck fields, rendering on a new #page.
So I have tried to add:
But it doen't seems to work for me.
Any idea?
Comment #14
ravi shankar karnati commentedprint theme_tabset($node->content['fieldgroup_tabs']);this line works fine for me for include the tabs in node tpl, Great , wonderful, Thanks a lot....but only problem is when ever i put this code in node tpl file Print option is not working fine,,
plz check the below link
http://196.12.61.134:8888/connellfoley/print/92
it shows like that, no tabs and no print option pop up..
plz help me
Thanks in advance...