Forum

Thread tagged as: Question, Problem, Error

Problem creating slug from date field

I'm trying to create a slug from a date field. The value of the slug field becomes weird (not human readable).

<perch:content id="news_date" type="date" label="Datum" fieldorder="dmy" required="true"  /> 
<perch:content id="slug" for="news_date" type="slug" suppress="true">

Example. Date is 2016-05-14

news_date outputs "2016-05-14" slug outputs "ra-d41d-cd98"

I checked and this is also how the values are stored in the database. Perch is up to date.

Tim Kinali

Tim Kinali 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

With dates you need to target the fields independently:

for="news_date_year news_date_month news_date_day"

Ahh OK, thanks!