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
1
vote
2 answers

Slug in Korean not working in Django even with 'allow_unicode=True'

I'm trying to make an automatic slug using the slugify in django.utils.text. The following are my code: # models.py from django.db import models from django.contrib.auth.models import User from django.utils.text import slugify class…
SihwanLee
  • 129
  • 1
  • 9
1
vote
1 answer

Best practise for sluggification of certain characters

So, let's take, for example, the following sentence: Chandra Source Catalog Release 2.0 I've run this through various string.to_slug() and sluggify(string) methods on different platforms and systems. The outcome is always the…
Micheal J. Roberts
  • 3,735
  • 4
  • 37
  • 76
1
vote
1 answer

Django AutoSlugField not considering soft deleted instances by Django Safe Delete

In our model we have a name and slug fields. This is how it looks like: class MyModel(CommonInfo, SafeDeleteModel): name = models.CharField(_('Name'), max_length=255, null=True, blank=True) slug = AutoSlugField(_('Url'), populate_from='name',…
Ale
  • 2,282
  • 5
  • 38
  • 67
1
vote
0 answers

Why is the URL different than the annotation in Symfony 5?

I want to access a specific product from a homepage : {{ property.title }} I specified the route in the controller /** * @Route("/property/{slug}-{id}",…
Charlene C
  • 15
  • 5
1
vote
2 answers

Dockerfile setting a home directory

I am writing a dockerfile, where one of its dependencies can only be installed only when a homedirectory exist, but how do I set something like that up? ARG BUILD_FROM=raspbian/stretch:latest FROM $BUILD_FROM RUN apt-get -qq update \ &&…
square
  • 11
  • 1
  • 3
1
vote
1 answer

How to add index to my slug if it already exists in database?

When i create new post i need to do next: 1. Generate slug from self.title with slugify 2. Check if this slug does not exists we save post with self.slug 3. If this slug already exists we save post with self.slug + '-' + count index I found worked…
1
vote
1 answer

Slug not rendering detail page in Django 2.0

What is the best way to use slug in this case and make it work properly. I can see the URL on the browser display the items requested but i am unable to render the detailed page. I cant find where the issue is coming from. When i access…
Curtis Banks
  • 342
  • 4
  • 20
1
vote
2 answers

Convert single quote to separators in the url_title function in CodeIgniter

In CodeIgniter, the url_title function takes a "title" string as input and creates a human-friendly URL string with a "separator" (dash or underscore). Currently, the function remove single quote. In french, the single quote (apostrophe) is a word…
Fifi
  • 3,360
  • 2
  • 27
  • 53
1
vote
4 answers

Codeigniter blog application: avoid duplicate entry error for slug

I am working on a basic blog application in Codeigniter 3.1.8 and Bootstrap 4. The posts table has a slug column that I intend to use at making SEO friendly URLs. Because every individual post's slug will be a part of it's URL, the slug column is,…
Razvan Zamfir
  • 4,209
  • 6
  • 38
  • 252
1
vote
1 answer

ajax datatable laravel Linking

I have a datatable using yajrabox package with links to various strings. When I click on a link, it takes me to a 404 page with "/teams/"string". How do I make this string a viewable page? I have tried using a slug, but I could be using it…
Bw70316
  • 37
  • 2
  • 12
1
vote
1 answer

Laravel sluggable

I am using this package for slugs in my Laravel 5.5 app. I was upgrading from Laravel 4.2 and I followed upgrade instructions, so now I have this in my model: public function sluggable() { return [ 'slug' => [ 'source' =>…
Norgul
  • 4,613
  • 13
  • 61
  • 144
1
vote
1 answer

how to call a method that is out of the class and pass the class instance to it in python django

I have a model named Klass with below code: class Klass(models.Model): title = models.CharField(max_length=50, verbose_name='class name') slug = models.SlugField(default=slug_generator, allow_unicode=True, unique=True) and it's the slug_generator…
msln
  • 1,318
  • 2
  • 19
  • 38
1
vote
1 answer

How can I convert a string slugify in the equivalent in human

I want transform a string that it is slugified in another string that it is the equivalent in human readable? I take the parametesr from an url: bookmark/10/disco%20asdasd So I have the nome that is "disco%20asdasd". But in this way it not…
Picco
  • 423
  • 2
  • 6
  • 21
1
vote
2 answers

Slugify name field in django form

I have model which has Meta: unique_together = ['slug', 'person'], person is foreign key field. In my form I don't want to type slug field. I want to populate it from child_name field. I tried as: class ChildForm(SlugCleanMixin,…
dj pro
  • 183
  • 1
  • 3
  • 17
1
vote
1 answer

Image POST php slug

I'm trying to make a slug name to image while upload, i was testing with str_replace but it doesn't work. $_FILES['imgProfile']['name'] = str_replace("í", "i", $_FILES['imgProfile']['name']); it returns something like: i?magen.png and doesn't…