Forum
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).
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
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.