Questions tagged [slug]

part of a URL that makes it more human readable or SEO-friendly, but without necessarily being required by the web server.

A slug is a part of a URL that makes it more human readable or SEO-friendly, but without necessarily being required by the web server. Slugs can be generated from a page title and are typically the last part of the url.

Example:

  • Page Title: c# - What's the difference between String and string? - Stack Overflow
  • Slug: whats-the-difference-between-string-and-string

The full URL including the slug is https://stackoverflow.com/questions/7074/whats-the-difference-between-string-and-string. Note that punctuation in the url is typically removed.

1272 questions
4
votes
1 answer

How to create a slug route excluding some slug in laravel routing?

I've following routes currently. $router->get('/contact-us','HomeController@contactUs')->name('contact-us'); $router->get('/about','HomeController@about')->name('about'); Now, I want to make general pages accessible form following…
Sagar Gautam
  • 9,049
  • 6
  • 53
  • 84
4
votes
6 answers

TYPO3 9.5 LTS - Automatic (re)generation of URL Segments?

I have deleted all Slugs in my DB in hope that they regenerates automatically - but they dont! Is there any way to trigger the regeneration? When upgrading from TYPO3 < 9 the get initially generated - but how? Thanks for helping :)
Naderio
  • 1,306
  • 11
  • 26
4
votes
3 answers

How to auto generate slug from my Album model in django 2.0.4

I have an Album field with a list of Songs class Album(models.Model): artist = models.CharField(max_length=250) album_title = models.CharField(max_length=250) genre = models.CharField(max_length=100) album_logo =…
james morgan
  • 123
  • 1
  • 1
  • 9
4
votes
1 answer

Wordpress SLUGS: Override categories with pages?

So I am working on a large media site using Wordpress. I want to create customised category pages, rather than using a blanket template throughout. I am aware that I can copy the php files, rename them and customise those. But I have come across an…
BHIZ
  • 41
  • 2
4
votes
4 answers

WordPress slug without custom post type slug

I have register custom post type with following code: register_post_type( array( 'labels' => // array of labels, 'public' => true, 'publicly_queryable'=> true, 'show_ui' …
Jaydip Nimavat
  • 603
  • 9
  • 19
4
votes
2 answers

C# Mvc Generic Route using Slug

I'm trying to create a generic route to work with slugs, but I always got an error The idea is, instead of www.site.com/controller/action I get in the url a friendly www.site.com/{slug} e.g. www.site.com/Home/Open would be instead…
Michel Ayres
  • 5,891
  • 10
  • 63
  • 97
4
votes
1 answer

Coldfusion regex to generate slug

I have this function to generate slugs in Coldfusion:
walolinux
  • 531
  • 1
  • 6
  • 20
4
votes
2 answers

AngularJS UI router root scope slug routes

I'm trying to implement a route for the root scope like /#/profile-1 /#/profile-2 /#/developer-name Guess you get the idea. I'm using AngularJS 1.4 and UI Router 0.2.15. My problem is now that I have this route, it's the last one in the order of my…
floriank
  • 25,546
  • 9
  • 42
  • 66
4
votes
2 answers

Link ID in wordpress url

Currently I am working on a wordpress website, but I stumbled upon a little problem. I am using wp_page_menu to make a navbar to get to my other pages. Now it directs me to www.mysite.com/sport, but I need it to direct me to…
Jeramai
  • 122
  • 10
4
votes
2 answers

Symfony create slug from entitys title

I have a working blog but I thought a bit late about nice urls. I dont want to use slugable and so on bundles because I dont have much time to read documentations and implement them. Is it possible to reach a field of an entity and generate the slug…
fagyi
  • 93
  • 2
  • 8
4
votes
2 answers

Problem in displaying a URL slug with dash

I made a slug with dash for my stories URLs such as: Fetching records with slug instead of ID This is my code to create slug : function Slugit($title) { $title = strip_tags($title); // Preserve escaped octets. $title =…
Mac Taylor
  • 5,020
  • 14
  • 50
  • 73
4
votes
1 answer

Is there a way to change the url paths in CKAN?

I want to change mysite.org/organization/someinstitution to mysite.org/institution/someinstitution In ckan/ckan/config/routing.py the urls are defined like this: m.connect('organization_read', '/organization/{id}', action='read') Is there a way to…
Urkonn
  • 90
  • 6
4
votes
3 answers

friendly-id: Undefined method slug for Movie

I downloaded the friendly_id gem in order to make my URLs more user friendly. To honor their instructions, I am asking this here instead of on GitHub. Here is my Show Method def show @movie = Movie.friendly.find(params[:id]) end This is in…
Johnson
  • 1,679
  • 1
  • 14
  • 21
4
votes
3 answers

How to automatically create utf8 slug in Django?

I want Django to automatically create slug for this model: class News(models.Model): title = models.CharField(max_length=100) body = models.TextField() teaser = models.TextField('teaser', blank=True) …
qliq
  • 11,695
  • 15
  • 54
  • 66
4
votes
1 answer

Incrementing the slug by avoiding Integrity error in django models save method

I have a model with two fields as below models.py class Publisher(models.Model): name = models.CharField(max_length=200) slug = models.SlugField(max_length=150, unique=True) def save(self, *args, **kwargs): if not self.id…
Shiva Krishna Bavandla
  • 25,548
  • 75
  • 193
  • 313