4

I would like to basically make a node with some tabs on the left that switch what's being viewed on the right. I can structure the content however I'd like since it's a node; is there a way to simply make the content display inside vertical tabs, like on the node editing forms, but when viewing the form?

Does the Render API allow rendering content in vertical tabs in a node?

  • I had to read it 4 times, and still don't get what you are asking :) – corbacho Jul 9 '11 at 19:51
5

See the Quicktabs Module.

| improve this answer | |
4

If I'm not mistaken, Field Group module offers that.

| improve this answer | |
  • Ah, so it does... didn't even look further into that! However, that's only for putting certain fields inside fieldgroups, which is only part of the solution for my needs. – geerlingguy Jul 10 '11 at 6:52
1

I've upvoted both of the other answers, because they're both helpful, but not exactly what I'm requesting. I want to display tabs inside a node, with content from the body field. I found that I can add in jQuery UI tabs by adding the appropriate js library and javascript to a particular node.

See: http://dansilvercentral.com/jquery-ui-tabs-drupal-7-tutorial for an example.

Also, to facilitate easier implementation of this on a node-by-node basis, I have a custom module to add an on-site admin interface to choose which pages should get the library added to them, and I'm using Code per Node to be able to simply add the JS right on the page in the node edit form. I'd rather not have to keep adding to a custom module to support content being added and maintained on the site.

| improve this answer | |
  • 1
    I'm not sure if I understand everything you're saying, but from the sound of it, I'm afraid you're creating a monster that is going to be difficult to maintain as your site grows. IMHO, the body field is not the best solution if you need to define separate pieces of content. I would use a multi-value text field for that, and find a way to make a vertical tab for each row. – marcvangend Jul 10 '11 at 12:23
  • That's a good idea, too, but for my site purposes, I only need to do this on two pages, and the person editing those pages is perfectly happy working in the HTML. If I were to have this be a feature on more pages, I would think about having a multi-value body text area, and have a multi-value textfield above so someone could set labels... then in hook_node_view or something I could do what you suggest. – geerlingguy Jul 15 '11 at 18:42
0

I would recommend Display Suite, which does precisely this (among many other things) with custom view modes for your content type.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.