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
1 answer

Error while Creating title Slug Notice: iconv(): Detected an illegal character in input string in

I used this code from Stackoverflow to creat a title slug from a string function slugify($text) { // replace non letter or digits by - $text = preg_replace('~[^\pL\d]+~u', '-', $text); // transliterate $text = iconv('utf-8',…
Harsha Kodali
  • 74
  • 1
  • 8
0
votes
0 answers

django slugify thailand umlauts

i need to create Thai language slug but after i use slugify not working Models.py from django.utils.text import slugify title = models.CharField(max_length=80,unique=True) slug = models.SlugField(max_length=80,unique=True,allow_unicode=True) …
0
votes
0 answers

npm Slugify installation

When I try to install Slugify using npm i slugify, I get an error saying :- C:\Users\2217445\OneDrive - Cognizant\Desktop\Nodej\natures> npm i slugify npm WARN natures@1.0.0 No repository field. npm ERR! code ENOENT npm ERR! syscall rename npm…
0
votes
0 answers

PHP dynamic URL slugs with multiple languages

I am trying to create PHP pages with SEO-friendly slugs like so: www.example.com/italian-foods www.example.com/de/italienisches-essen www.example.com/it/cibo-italiano Links are created with php-i18n and slugify like so:
Fid
  • 462
  • 4
  • 21
0
votes
0 answers

How to keep actual file path accessible when the file has permalink key in the frontmatter?

Say a file is at actual/path/. Would having this permalink key in the frontmatter: --- permalink: "a/different/path" --- making the link https://example.com/actual/path not working anymore? It seems yet, although the documentation doesn't seem to…
Ooker
  • 1,969
  • 4
  • 28
  • 58
0
votes
0 answers

How to make Django slugify not duplicate with Unicode strings?

So basically it works fine, but it creates duplicates of slug for some reason class News_Tag(models.Model): title = models.CharField(max_length=150) slug = models.SlugField(null=True, blank=True) def __str__(self) -> str: return…
0
votes
1 answer

Slug returns Reverse for '' with arguments '('',)' not found. 1 pattern(s)

I am trying to make it so when I view a blog from any particular link on my website, the url displays www.example.com/view-blog/slug. I have got it working for my images and image title. But I cannot get it to work with blog titles. It keeps…
David Henson
  • 355
  • 1
  • 10
0
votes
3 answers

Django URLs not updating after slug change

I use Slugify. After making a change in slug for all objects in Entry, slug still shows as old slug. If I refresh obj page, I get a page not found, unless I click "back" and then reopen the obj page, and that is when the obj page will load and new…
PolarBear
  • 97
  • 5
0
votes
2 answers

Django Slugify with blank object field printing "none" in url

class Entry(models.Model): name = models.CharField(max_length=200, null=True, blank=True) city = models.CharField(max_length=200, null=True, blank=True) zip_code = models.ManyToManyField('EntryTwo', related_name="entries", blank=True) …
PolarBear
  • 97
  • 5
0
votes
0 answers

duplicate key value violates unique constraint "menu_category_category_name_key" DETAIL: Key (category_name)=(Sardine) already exists

good day, please guys im working on a project whereby a vendor have to enter category of food they have so when i tried to add the same Category of food for two different vendors im seeing this error, to my own perspective i thought two vendors…
0
votes
0 answers

Gatsby Page Creator Slugify Options

{ resolve: `gatsby-plugin-page-creator`, options: { path: `${__dirname}/src/pages/places/`, slugify: { customReplacements: [['.', '..']] }, }, }, This is my plugin in gatsby-config. I am trying to preserve the…
hera93
  • 1
0
votes
0 answers

how to give unique suffix for cviebrock / eloquent-sluggable

im using cviebrock / eloquent-sluggable to make slug, but as they said in their documentation: "For example, if you have two blog posts and both are called "My Blog Post", then they will both sluggify to "my-blog-post" By setting unique to true,…
0
votes
1 answer

My presave slugify function seems to have stopped working in localhost, but not on deployed version? Has this happened to anyone else?

I have been working on a dog adoption website which I have been builing on my local host in python using the Django framework. I have a python page which uses the pre-save function to create a unique slug for the dog whenever one is created. I have…
0
votes
1 answer

Could not parse the remainder: 'slug=blog.slug' from ''blog_details'slug=blog.slug'

i am using slug field in my blogs. here's how i am creating slugs views.py def Creating_blog(request): form=BlogForm() if User.is_authenticated: if request.method=='POST': form=BlogForm(request.POST,request.FILES) …
Abu RayhaN
  • 359
  • 1
  • 3
  • 11
0
votes
2 answers

How do I slugify the pages I pull while using the Notion API?

I want to make a blog site on my Next.js based personal website using Notion API. I must say that I am a newbie to Next.js and Notion API. I don't have a problem pulling the posts, but I want to slugify the id's in the endpoints to replace them with…