Forum

Thread tagged as: Problem, Configuration

Can I make _id the slug?

I have in the members app section a list and detail page of a list of contact names and card details. At some point there will be more than one "John Smith". At that point making the name the slug will fail. So I need to add or use something more unique in the slug. It's hidden from the public so does not need to be pretty.

So I thought I could use something like...

<perch:content id="name" type="text" />
<perch:content id="_id" type="hidden" />
<perch:content id="slug" for="_id name" type="slug" suppress="true" />

name is added OK. _id can be output on the page but does not go into the slug.

Any ideas making the URL unique?

David Owen

David Owen 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Slugs are only created from items sent with the form - which _id is not.

Could you not just use _id and no slug?

How do I just use `_id' with no slug? As in is I thought you had to use {slug}

So I filter on _id rather than slug

'filter'   => '_id',`