Forum

Thread tagged as: Runway

Create a composite slug which includes related collection

Hello,

How can I create a composite slug (based on multiple inputs), including a related collection?

Here is the code:

<perch:related id="book" collection="Books" label="Book" scope-parent="true"><perch:content id="title" /></perch:related>
<perch:content id="title" type="text" title="true" label="Title" required="true">
<perch:content id="subtitle" type="text" label="Subtitle">
<perch:content id="slug" type="slug" for="book.title title subtitle" editable="true" indelible="false" label="Slug" required="true">

The composite slug ignores the related collection, it collates the 2 other inputs (title and subtitle).

Stéphane Mégécaze

Stéphane Mégécaze 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't think you can at the moment.

If we were to add it, how would you expect this to behave when there are multiple related items?

Thanks for the fast reply.

I there was more than one item, I'd expect them all to appear in the slug: collection-title1-collection-title2-title-subtitle

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, thanks, we'll take a look into it as a possible future enhancement. For right now, I'm not sure I have a good solution for you.