| 1 |
$Id: README.txt,v 1.5 2007/04/07 15:25:04 fago Exp $ |
$Id: README.txt,v 1.6 2007/10/30 11:17:38 fago Exp $ |
| 2 |
|
|
| 3 |
Automatic Nodetitle Module |
Automatic Nodetitle Module |
| 4 |
------------------------ |
------------------------ |
| 7 |
|
|
| 8 |
Description |
Description |
| 9 |
----------- |
----------- |
| 10 |
This is a small and efficent module that allows hiding of the node title field. To prevent |
This is a small and efficent module that allows hiding of the content title field. To prevent |
| 11 |
empty node title fields it sets the title to the content type name or to an configurable |
empty content title fields it sets the title to the content type name or to an configurable |
| 12 |
string. If the token module is installled it's possible to use various node data for the |
string. If the token module is installled it's possible to use various content data for the |
| 13 |
autogenerated title - e.g. use the text of a CCK field. |
autogenerated title - e.g. use the text of a CCK field. |
| 14 |
|
|
| 15 |
Advanced users can also provide some PHP code, that is used for automatically generating an |
Advanced users can also provide some PHP code, that is used for automatically generating an |
| 26 |
type. |
type. |
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
Advanced Use: Combining tokens and PHP |
Advanced Use: Combining tokens and PHP |
| 31 |
--------------------------------------- |
--------------------------------------- |
| 32 |
|
|
| 42 |
return $token; |
return $token; |
| 43 |
} |
} |
| 44 |
?> |
?> |
| 45 |
|
|
| 46 |
So if the text of the CCK textfield [field_testtext-raw] isn't empty it will be used as title. |
So if the text of the CCK textfield [field_testtext-raw] isn't empty it will be used as title. |
|
Otherwise the node type will be used. |
|
|
|
|
|
|
|
|
Advanced Use: Accessing $node from PHP |
|
|
---------------------------------------- |
|
|
If you prefer to not use the token module, the best way to access $node is: |
|
|
|
|
|
<?php |
|
|
global $form_values; |
|
|
$node = (array)$form_values; |
|
|
.. |
|
|
?> |
|
|
However, the node does just contain the form_values as submitted by the user. Any data |
|
|
processing the modules might do with their fields will be done later. |
|
|
For sure it's easier to go with the token module! |
|
| 47 |
|
Otherwise the node type will be used. |