The unless check of an alternate field succeeds even if that field exists but is blank. Please enhance the check to not match on blank fields.
This was also noted in ARC Answers [ARC-1500] Change article url to limit taxonomy path - Boston.com
by another customer.
We have tried to use a seemingly obvious use case to use the headlines.meta_title field if populated, otherwise use the headlines.basic field.
[ARC-1500] Change article url to limit taxonomy path - Boston.com
%headlines.basic|unless({"check":"headlines.meta_title","then":"headlines.meta_title"})%
This works if we have any value in meta_title. It also works if the ANS omits the headlines.meta_title field.
However, when the field is included in the ANS (which seems to be totally outside of our control), then the headline portion of the url is blank.The ANS is as follows:
"headlines": {
"basic": "john is tesitng the url why is this head no good",
"mobile": "",
"native": "",
"print": "",
"tablet": "",
"web": "",
"meta_title": ""
}
So we are not able to use the unless check at all.
Agreed. We have our URLS use the headline unless there is a slug:
article/%publish_date|year()%/%publish_date|month()%/%publish_date|day()%/%headlines.basic|unless({"check":"slug","then":"slug"})|slugify()%/
If a user even clicks in the slug field, not entering text, it gets added to the ANS and produces a bad url.