Hi everyone,
I need to do something for wich I didn't find any available module.
So, I plan to develop it myself and then release it to the community, but before I start I want to make sure that it doesn't already exists (or something that could produce the same result), and - if it doesn't - I would like some piece of advice.
Here is my need :
I have a custom node type (made with CCK) with serveral long text field, and I need to "split" the node display into several tabs based on per field rules.
For example :
the node type "mynodetype" contains fields :
mynodetype :
- title
- body
- myfield1
- myfield2
- mygroupfield1
- myfield3
- mifield4
- myfield5
By default, all the fields are displayed on the same page (except if I hide some in "admin/content/node-type/mynodetype/display")
I want my node to be displayed like :
defaultTab
- title
- body
secondtab
- title
- myfield2
- myfield5
thirdtab
- title
- mygroupfield1
- myfield3
- mifield4
I checked the "paging" and the "cck fieldgroup tabs" modules but they don't correspond to what I need (or maybe they do but I didn't find how to do it ?).
Paging splits the node on lenght or page break and don't provide any tab.
cck fieldgroup tab allows only fieldgroups to be assigned to a tab (and not single fields) and is not very flexible (one tab per fieldgroup, no default tab ...)
I guess there must have been lot of other people who had to do something similar, so is there a module already available or an easier way ?
If not, then I will make this module ... I already did a few custom module developpement for D6, but not that much ... so I know how to do a module, but I would apreciate your ideas, suggestions about architecture, existing mecanisms to rely on, hooks to implement etc ...
Thanks,
Hervé
Comments
This functionality already
This functionality already exists with the following projects.
http://drupal.org/project/cck_fieldgroup_tabs
http://drupal.org/project/tabs
you can view the functionality on my website at http://www.nacecare.com/products/ttv678 if you would like to look at the output.
Thank you Tim, I already
Thank you Tim,
I already tried these modules, but I didn't manage to "split" the node as I have to.
My problem with cck_fieldgroups_tabs is that I can't choose the tabs (or maybe I missed something ?) : they are built automatically on field groups, and that's not what I want to do (I already have field groups that I neek to keep, and it doesn't seem possible to make groups of groups ... or maybe I missed something more once again ?).
Is it possible to use these module in a more flexible way ? Can you tell me a little bit more about how you did it please ?
Thanks again,
Hervé
PS : some of the french translations in your site seem to be not very good ... I'd be glad to help you a little bit (at least for the home page) if you can help me :)
With the two modules
With the two modules combined, you have to adjust your content type.
Step 1: Create a content type with all of the field sets. Each fieldset will be a different tab on the page.
Step 2: Create items under those field sets (i.e image, body, file) using CCK (and imagefield, filefield if required)
Step 3: go to /admin/content/node-type/page/display and adjust the display settings for each fieldset.
In my case I have
Machine Specs (Fieldset)
Image (Imagefield image)
Body Area
Body Area for PHP code
Accessories (Fieldset)
Accessories (Body Area for custom PHP code)
Images (Fieldset)
Machine Images (Imagefield Images)
The result is what you see on my site if that is exactly what you are after.
If you send me your e-mail address, I can send you screen shots of exactly what I have set up.