Forum

Thread tagged as: Question, Blog

Options for slug for Perch Blog

Hi,

A few of my clients want different functionality with the way the slug works on Perch Blog.

It’d be nice so that the slug can be edited as we’d like. At the moment if the title gets edited after posting, it breaks the existing links which frustrates some clients.

It’d be good to be able to have an indelible option as well as editable?

Cheers!

Ryan Gittings

Ryan Gittings 1 points

  • 3 years ago

Does that not exist? It appears in Shop in the example product.html:

<perch:shop id="slug" type="slug" editable="true" indelible="true" label="Slug" for="title sku" order="10" divider-before="Meta data" />
Ryan Gittings

Ryan Gittings 1 points
Registered Developer

It does, but unless I’m missing something obvious it doesn’t exist in the blog as of yet for the main blog post slug.

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hi Ryan,

I tested this a while ago and for some reason I thought it didn't work well, but this seems to work now (the slug format in the settings is set to {postTitle} so it matches the for attribute):

<perch:blog id="postSlug" type="slug" for="postTitle" label="Slug" editable suppress>

Hi Ryan. How did you get on with this? I have a solution pretty much the same as Hussein's, but using the older perch template tag syntax.

<perch:blog id="postSlug" type="slug" editable="true" label="Blog Post Slug" help="Edit blog slug." for="postTitle" suppress="true" />
Ryan Gittings

Ryan Gittings 1 points
Registered Developer

Perfect, thanks both! I wish that was in the docs, super simple.