Questions tagged [slugify]

Slugify is a PHP library which helps to convert a string into a slug.

Slugify

  • Removes all special characters from a string. Provides custom replacements for German, French, Spanish, Russian, Ukrainian, Polish, Czech, Latvian, Greek, Esperanto¹, Arabian, Vietnamese and Burmese special characters.
  • Instead of removing these characters, Slugify approximates them (e.g., ae replaces ä).
  • No external dependencies.
  • PSR-4 compatible.
  • Compatible with PHP >= 5.3.3 and HHVM.
  • Integrations for Symfony2, Silex, Laravel, Twig, Zend Framework 2, Nette Framework and Latte.
63 questions
206
votes
26 answers

How to convert a Title to a URL slug in jQuery?

I'm working on an app in CodeIgniter, and I'm trying to make a field on a form dynamically generate the URL slug. What I'd like to do is remove the punctuation, convert it to lowercase, and replace the spaces with hyphens. So for example, Shane's…
GSto
  • 41,512
  • 37
  • 133
  • 184
31
votes
2 answers

How to use slugify in Python 3?

I'm trying to use slugify, which I installed using pip3 install slugify. However, in the interpreter, if I try to slugify the string 'hello' I see the following: Python 3.5.2 (default, Nov 17 2016, 17:05:23) Type "copyright", "credits" or "license"…
Kurt Peek
  • 52,165
  • 91
  • 301
  • 526
4
votes
2 answers

name 'slugify' is not defined

Once a user had logged into my site he could write a post and update it. Then I was making progress in adding functionality which allowed people to make comments. I was at the stage where I could add comments from the back end and they would be…
Ross Symonds
  • 690
  • 1
  • 8
  • 29
3
votes
1 answer

Symfony, generate slug from submitted form

I have this form which I want to modify in order to add a slug field which should be generated from user submitted data. Like user chosen category (name), and random words from content, and I'm also using Slugify for cleaning up URLs: Any idea? $u…
cybernet2u
  • 146
  • 1
  • 3
  • 14
3
votes
3 answers

Symfony Doctrine Sluggable extension in existing database

I had to add in an existing entity a slug field to slugify the field 'name'. But there is already data in this entity and I can't delete them. I would like to create a console script which can slugify all my 'name' field. I don't know how to do it…
Kevin
  • 4,823
  • 6
  • 36
  • 70
2
votes
1 answer

No Module named Slugify in Odoo 12

I came across a module from GitHub and I went through the steps to install, but I am getting this error: Unable to install module because an external dependency is not met: No module named slugify However, Slugify is installed: Requirement already…
2
votes
1 answer

Conflict between python-slugify and awesome-slugify

I am using the awesome-slugify python library (1.6.5) but for another Django app I need also to use the csvkit python library (version 1.0.3). Once I install the csvkit (pip install csvkit), I start getting an error when importing the Slugify. I…
user1919
  • 3,818
  • 17
  • 62
  • 97
2
votes
1 answer

How can I make Django slug and id work together?

I want my URL to contain both id and slug like StackOverflow, but the slug is not working properly. Instead of being like this: www.example.com/games/155/far-cry-5 the URL is like…
DAMAR225
  • 1,993
  • 1
  • 13
  • 22
2
votes
1 answer

django 1.9 slug field is not working for foreign language

I am building a post app, which automatically creates slug from the post title. If there is any foreign language in title, slug is not getting generated. I have already gone through some of the answers here, but it's not helping much. Am I missing…
Ankit
  • 101
  • 5
1
vote
1 answer

Django rest framework using Template to send an e-mail

I want to send a styled email using HTML tags. The mail is sent successfully but without style and the HTML tags are presented as a text in the email. handles.py @receiver(order_created) def on_order_created(sender, **kwargs): …
1
vote
1 answer

validation failed: slug: Path `slug` is required

I created a Blog and for its slug, I install slugify and require it. I'm trying to save a new blog post in MongoDB with mongoose, but I am getting this error: slug: ValidatorError: Path slug is required. I validate slugify from the tutorial from Web…
1
vote
1 answer

NextJS Slugify route but make normal api request

i have a dynamic NextJS Route based on a Title from a Directus CMS. But these Titles have sometimes Special Characters (like Spaces, Quotes, or something else), and the Data is fetched based on the URL-Title with a GraphQL Client. And i want to…
Blizii
  • 173
  • 11
1
vote
1 answer

Why do I need to use SlugField in Django?

I searched on google and found this: "SlugField is a field for storing URL slugs in a relational database. SlugField is a column defined by the Django ORM. SlugField is actually defined within the django.db." But still, the definition sounds a…
Cyebukayire
  • 795
  • 7
  • 14
1
vote
1 answer

Detail page error after using slugify in django

I am getting this error when i click on any item detail page. Generic detail view must be called with either an object pk or a slug in the URLconf. URL: path('item//', ItemDetailView.as_view(), name='item_detail'), VIEW: class…
Waqart
  • 113
  • 1
  • 8
1
vote
6 answers

Getting an Error: slugify: string argument expected

I try to create category to eCommerce project then it throws an error Postman - throws an error These are source codes location: ecommerce-backend\index.js const express = require('express') const env = require('dotenv') const app =…
K SNP
  • 15
  • 1
  • 4
1
2 3 4 5