By KingMoore on
On the manage fields screen of my content type there are a number of system supplied fields that are greyed out (Groups, Title, Body, etc.). I cannot move these to within a field group by dragging. Is there any way to get them into a field group?
Comments
I have the same issue: -
I have the same issue:
- body
- title
are not movable to a group.
That's because Body and
That's because Body and Title are not CCK fields. Fieldgroup won't support changing locations of non CCK form elements. The modules that define those fields need to be able to find those form elements where they put it, changing this under them would open up very interesting ways of breaking lots of different things.
Workaround?
Same issue here... Are we not able to make this a special case grouping that is only visual? Not having the ability to group make CCK nodes looking strange and unordered and not user friendly. I would also be more happy if I'm able to completely remove the two standard fields and create my own.
_
As indicated in the instructions on the node edit form, removing the 'body' label should remove the field. You cant remove the title field, but you can use http://drupal.org/project/auto_nodetitle to hide it. Then use cck fields for everything and group as you wish.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
I'd be wary of this route --
I'd be wary of this route -- it's hackish. First, you have the title data in two different fields. Then you have a blank body but another CCK field pretending to the body. I see complications down the line with regard Drupal's auto generated Teaser string as well as search indexing.
Possible solution
After much try/fail, I was able to get this working. I moved my body field into a CCK field group with a form override. Here's the code:
The way it works, is it tacks the body field onto the array of your fieldgroup, then it wipes out the value of the old body field (so it does not display twice).
My setup uses some custom modules to let me override forms with template files. To do this, put this code inside template.php:
Then create a file called mytype_edit.tpl.php, where mytype is whatever your content type is (example: story-edit.tpl.php). That's where you should place your node form overrides.
Another solution, which I
Another solution, which I prefer because I already have a hook_form_alter module defined this:
Hmm... it seems that moving
Hmm... it seems that moving title to the field group causes the form to save without a title. It gets past validation, but then the string is empty on View and Edit.
OK, I figured out what was
OK, I figured out what was going wrong.
While it seems to be OK with pushing body_field onto the form, doing so with the title field doesn't work. I looked at the $form_state on save and saw that the title value was at the array key [0] instead of [title]. When you pus a value onto an array you are not supplying an explicit key value and so you get an auto-incremented number -- much like a unique key in a database.
For title, we need to set the array key explicitly. Here is the code block with the correction:
you are duplicating
you are duplicating form_alter in method name. You should call it mymodulename_form_alter
Move Node Title into CCK Standard group (field group)
The best way to go about this is to use the '#after_build' hash.
Example:
But what about 'view'
Hi, your solution worked. I just would also be interested to do this for the node view mode, and not only the view edit form.
You can do it for view
Go here:
admin/content/node-type//display
Then check the 'hidden' checkbox for your group_field
Agreed ++
Agreed ++
Thanks, it's simple and it
Thanks, it's simple and it worked for me.
Such things should be collected to some sort of Drupal FAQ named "How to fight all these little annoying restrictions" :)
Have encountered too much of them already...
Thanks
Jduff
your solution works perfectly!!
You can do this by editing
You can do this by editing content type below Multistep Form setting here is extra fields setting here u can set which field goes to which group. i.e title, body, taxonomy etc
Sorry, your comment is a bit
Sorry, your comment is a bit unclear. Could you explain what you mean "below Multistep Form setting"? Where is this Multistep form setting?
Multistep
The previous poster is referring to the Multistep module. As the name suggests it provides the means to split up a CCK form into multi-page steps, but a residual benefit of the module is that it also allows the title and body to be added to a field group.
I tried out the multi step
I tried out the multi step module, does seem to enable this nicely. I would prefer to use cck fieldgroup tabs myself instead of the "wizard" approach, so if nothing else, perhaps I can dig through multistep to see how they're moving these non-CCK fields into the appropriate groups.
I just tried the Multistep
I just tried the Multistep module... it does give you some fashion of 'grouping' control, but I don't think it's what most people are looking for. Just to be clear it doesn't relate with Fieldgroups (the CCK module) at all. Grouping form components with Multistep gives you each group acting as a step in the form. Each step is it's own 'page', requiring a browser refresh, only showing the components for the particular group. You still don't have a class connection between form components to style a group visually on a single page... which is what I think people want ala CCK Fieldgroups.
How could it be done with the non-cck location (node location)
Could anybody teach me how to add the non-cck location into a fieldgroup? It seems like this forum would be the closest and fastest to answer.
Thanks
Robert Albert Young Chu
Added a feature request in
Added a feature request in CCK - http://drupal.org/node/1049520