You are here

README.txt in Automatic Nodetitles 6

Same filename and directory in other branches
  1. 8 README.txt
  2. 5 README.txt
  3. 7 README.txt
Automatic Nodetitle Module
------------------------
by Wolfgang Ziegler, nuppla@zites.net


Description
-----------
This is a small and efficent module that allows hiding of the content title field in the form.
To prevent empty content title fields it sets the title to the content type name or to an
configurable string. If the token module is installled it's possible to use various content
data for the autogenerated title - e.g. use the text of a CCK field.

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

Installation 
------------
 * (optional) Download and install the token module.
 * Copy the module's directory to your modules directory and activate the module.
 * For each content type you want to have an automatic title, click on the
   "edit" link for it on 'admin/content/types'
 * At the top of the content type edit form, there is a "Automatic title
   generation" box allowing you to configure the details for the current content
   type.


Note
-----
 Due to the way the module works, it is not possible to make use of some replacement
 tokens that are not available before the content node is saved the first time, e.g.
 like the node id ([node:nid]).


 Advanced Use: PHP Code
------------------------
 You can access $node from your php code. Look at this simple example, which just adds the node's
 author as title:
 
<?php return "Author: $node->name"; ?>

 
 
 Advanced Use: Combining tokens and PHP
 ---------------------------------------
 
 You can combine php evalution with the token module, because tokens are replaced first.
 However be aware to don't use this with any textual values provided by users as this would
 open a security hole. If you are in doubt, don't combine tokens with php evaluation.
 
 Here is an example:
 
<?php
  $token = '[field_testnumber]';
  if (empty($token)) {
    return '[type]';
  }
  else {
    return $token;
  } 
?>

 So if the text of the CCK number [field_testnumber] isn't empty it will be used as title.
 Otherwise the node type will be used.


 
 
 Updating nodetitles from existing nodes
 ---------------------------------------
 If you set the nodetitle to be auto generated for some content type, existing nodes
 are not affected. You can update existing nodes by going to 'admin/content/node',
 then filter for your content type, mark some nodes and choose the "Update option" 
 "Update automatic nodetitles". 
 
 

File

README.txt
View source
  1. Automatic Nodetitle Module
  2. ------------------------
  3. by Wolfgang Ziegler, nuppla@zites.net
  4. Description
  5. -----------
  6. This is a small and efficent module that allows hiding of the content title field in the form.
  7. To prevent empty content title fields it sets the title to the content type name or to an
  8. configurable string. If the token module is installled it's possible to use various content
  9. data for the autogenerated title - e.g. use the text of a CCK field.
  10. Advanced users can also provide some PHP code, that is used for automatically generating an
  11. appropriate title.
  12. Installation
  13. ------------
  14. * (optional) Download and install the token module.
  15. * Copy the module's directory to your modules directory and activate the module.
  16. * For each content type you want to have an automatic title, click on the
  17. "edit" link for it on 'admin/content/types'
  18. * At the top of the content type edit form, there is a "Automatic title
  19. generation" box allowing you to configure the details for the current content
  20. type.
  21. Note
  22. -----
  23. Due to the way the module works, it is not possible to make use of some replacement
  24. tokens that are not available before the content node is saved the first time, e.g.
  25. like the node id ([node:nid]).
  26. Advanced Use: PHP Code
  27. ------------------------
  28. You can access $node from your php code. Look at this simple example, which just adds the node's
  29. author as title:
  30. name"; ?>
  31. Advanced Use: Combining tokens and PHP
  32. ---------------------------------------
  33. You can combine php evalution with the token module, because tokens are replaced first.
  34. However be aware to don't use this with any textual values provided by users as this would
  35. open a security hole. If you are in doubt, don't combine tokens with php evaluation.
  36. Here is an example:
  37. $token = '[field_testnumber]';
  38. if (empty($token)) {
  39. return '[type]';
  40. }
  41. else {
  42. return $token;
  43. }
  44. ?>
  45. So if the text of the CCK number [field_testnumber] isn't empty it will be used as title.
  46. Otherwise the node type will be used.
  47. Updating nodetitles from existing nodes
  48. ---------------------------------------
  49. If you set the nodetitle to be auto generated for some content type, existing nodes
  50. are not affected. You can update existing nodes by going to 'admin/content/node',
  51. then filter for your content type, mark some nodes and choose the "Update option"
  52. "Update automatic nodetitles".