2

Here's what we'd like to do when create/edit node of specific type of content (we have 2 specific types, let's call them "type A" and "type B"):

  • hide the title (= the user can change all fields but not the title)
  • show a combo box to choose an item (lot of items, and this field is a long name)
  • depending on the type of the content, when validating the node, update the title like this: title = name of the item + " - " + type of the content

Example:

User creates a node of "type B". He chooses the item called "The item XYZ long name" and validates => the title of the node is auto-magically created: The item XYZ long name - Type B.

Any idea how to do this (I don't know how to hide the title when creating/editing a node as well)?

1 Answer 1

3

A great module you can use is Auto NodeTitle :

"auto_nodetitle" is a small and efficient module that allows hiding of the content title field in the form. To prevent empty content title fields one can configure it to generate the title by a given pattern.

When the token module is installed it's possible to use various node data for the auto generated title - e.g. use the text of a CCK field (since 5.x).

Advanced users can also provide some PHP code, that is used for automatically generating an appropriate title.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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