I want to create a custom node type with many fields but I dont want the title. By default, drupal makes it mandatory to enter a title for any node. How do I change this and make the title optional (and how do I remove title field for a particular node type)? please help me.

Thanks
Love,
Tosho

Comments

dsp1’s picture

just take your current node.tpl.php and copy and rename it to node-[nodename].tpl.php ie. node-forum.tpl.php

then remove the <?php print $title ?> from the file.

ToshoFreny’s picture

Thanks for answering, but i would like to make it clear that this is not my need. The solution you gave only disables the title field from being displayed, but still the title is necessary to create that kind of node.

My need is,
1. i want to create a node (a custom node, call it xyz).
2. when i create a xyz node, i should be able to submit it without entering a title in the title field.
3. optionally, i want to create a content type which DOESNT have the title field in it.

Loving Life,
Tosho Freny,
Reading why marriages fail? and Sex and the Osho at http://www.belovedosho.com/

KG2’s picture

I tried to follow your instructions for a custom content type called
content-manuscript_item

copied and renamed the file to

node-content-manuscript_item.tpl.php

removed print $title and it didn't seem to make any difference...

Is it perhaps because I'm using 4.7. Is there anything else I can try?

Any assistance would be greatly appreciated

groenm’s picture

Hello Tosho,

I am not sure if this will fit your needs, as I don't know if you really want to get rid of the title-field at all, or simply don't want to be bothered with entering anything in the field. In the latter case you might want to give the Automatic Nodetitles module a try. This module can hide the title field (for configured node types) and automatically generate text for it when you create the page. Maybe it even works with "generating" an empty title field?

Greetings,
Mark

ToshoFreny’s picture

Thanks GREOENM. I am exactly looking for that. I want the title to filled automatically like in Comment section and having not found a soultion for that I just want to get rid of the title as such. Your solution is cool. I gonna try it.

Just out of curisiosity, isn't there anyway where I can get rid of the title altogether>
Loving Life,
Tosho Freny,
Reading why marriages fail? and Sex and the Osho at http://www.belovedosho.com/

groenm’s picture

Hi Tosho,

I am not aware of a way of getting rid of the title altogether. But maybe there is one... I am working with Drupal for 6 months now, so I haven't seen all corners of this universe yet.

Mark

aklump’s picture

Try this module, sounds like it could help: http://drupal.org/project/auto_nodetitle