**SPIP**
# Article validated
The article "**\_TITRER\_DOCUMENTS**
(https://www.spip.net/en_article6606.html)" was validated by
<multi>[ar]جورج[fr]George [en]George</multi>.
* * *
## \_TITRER\_DOCUMENTS
Sunday 4 October 2020 , by [jack](.././?page=auteur&id_auteur=593&)
The constant `_TITRER_DOCUMENTS` will force the titling of documents from
the file name.
## Table of contents
* Behaviour
* Activation
* See also
## Behaviour[|Back to the table of contents](#s-Behaviour)
When a new document is added, this constant will force SPIP to take the
name of the file as the "title" of the document.
The title is based on the file name without its extension. Punctuation
marks (including "_" and "-") are replaced by spaces. Capital letters and
accents are preserved.
**Example : **
When adding the file `My_super-file.pdf`, the name saved in the database
will be "My super file".
Note: by default, the title is left blank.
## Activation[|Back to the table of contents](#s-Activation)
In your file `config/mes_options.php` (see the related article
(https://www.spip.net/ecrire/?exec=article&id_article=4909)) :
// Give the attached document the file name as title
if
(
!
defined
(http://www.php.net/defined)
(
'_TITRER_DOCUMENTS'
)
)
{
define
(http://www.php.net/define)
(
'_TITRER_DOCUMENTS'
,
true
)
;
}
## See also[|Back to the table of contents](#s-See-also)
* The DOCUMENTS loop
(https://www.spip.net/ecrire/?exec=article&id_article=2381)
* Adding a File Format
(https://www.spip.net/ecrire/?exec=article&id_article=2476)
— Sent by SPIP (https://www.spip.net/)
![]()