Forum

Thread tagged as: Question, Problem

Editable Slugs

I ran into an issue last night as I'm writing a blog post that has a £ symbol in it. I took a quick look around and realised that making the slug editable should do the job but I can't get it to work. It just doesn't show up in the admin area at all but it does show in the front end if I remove suppress="true".

Here's the code in my post.html template…

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

and the code in my post_in_list.html template is…

<a href="<perch:blog id="postSlug" />"...

If I change the id from postSlug to something else it will then show up in the admin but it doesn't save and my list page doesn't link through. Any pointers appreciated!

David Ellis

David Ellis 1 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

The postSlug field is a fixed field, so it works a little differently and doesn't have full template control.

Is there a way to get around it?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't believe so.

Ok no worries, thanks for getting back to me.

For anyone else running into this (problems with the £ symbol in URLs), I think this was related to me running a pretty old version of the blog app. I updated this morning and Perch seems to have automatically substituted the £ symbol for GBP in my slug. Problem solved.

Drew McLellan said:

The postSlug field is a fixed field, so it works a little differently and doesn't have full template control.

Just a quick related question, is sectionSlug also fixed?

Drew McLellan

Drew McLellan 2638 points
Perch Support

It is, yes.