| 1 |
$Id: README.txt,v 1.2.2.6 2008/12/30 20:05:07 fago Exp $ |
$Id: README.txt,v 1.2.2.7 2009/02/10 10:32:12 fago Exp $ |
| 2 |
|
|
| 3 |
Automatic Nodetitle Module |
Automatic Nodetitle Module |
| 4 |
------------------------ |
------------------------ |
| 40 |
--------------------------------------- |
--------------------------------------- |
| 41 |
|
|
| 42 |
You can combine php evalution with the token module, because tokens are replaced first. |
You can combine php evalution with the token module, because tokens are replaced first. |
| 43 |
|
However be aware to don't use this with any textual values provided by users as this would |
| 44 |
|
open a security hole. If you are in doubt, don't combine tokens with php evaluation. |
| 45 |
|
|
| 46 |
Here is an example: |
Here is an example: |
| 47 |
|
|
| 48 |
<?php |
<?php |
| 49 |
$token = '[field_testtext-raw]'; |
$token = '[field_testnumber]'; |
| 50 |
if (empty($token)) { |
if (empty($token)) { |
| 51 |
return '[type]'; |
return '[type]'; |
| 52 |
} |
} |
| 55 |
} |
} |
| 56 |
?> |
?> |
| 57 |
|
|
| 58 |
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 number [field_testnumber] isn't empty it will be used as title. |
| 59 |
Otherwise the node type will be used. |
Otherwise the node type will be used. |
| 60 |
|
|
| 61 |
|
|