Menu
×
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

Template Filter - slugify


Example

Convert a text into one long word:

<p>{{ text|slugify }}</p>
Run Example »

Definition and Usage

The slugify filter returns a text into one long word containing nothing but lower case ASCII characters and hyphens (-).

Meaning:

- All spaces converted into hyphens.

- Removing all characters that are not aphanumeric, except hyphens and underscores.

- Removes any underscores and/or hyphens at the very beginning or end of the value.

- Converting to lower case characters.

Example

Slugify a text with a lot of not alphanumeric characters:

<p>{{ text|slugify }}</p>
Run Example »

Syntax

{{ value|slugify }}

Template filters are defined by using a pipe | character followed by the name of the filter.