_TITRER_DOCUMENTS

The constant _TITRER_DOCUMENTS will force the titling of documents from the file name.

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

In your file config/mes_options.php (see the related article) :

// Give the attached document the file name as title
if (!defined('_TITRER_DOCUMENTS')) {
	define('_TITRER_DOCUMENTS', true);
}

See also

Author jack Published :

Translations : English, français, Nederlands