Ideas for Arc XP

Canonical URL service unless should ignore blank properties

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.

 

 

  • John Flaherty
  • Jul 12 2019
  • Future consideration
  • Attach files
  • Heather Young commented
    October 06, 2020 13:09

    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.