Configuring URL formats
Use the Formats page in Canonical URLs to create and manage the rules for generating canonical URLs. Every story, video, and gallery has a canonical URL assigned to it for every website where it is used. The system generates a canonical URL when the content is published based on rules stored on the Canonical URLs Formats page.
Each format has:
a website, as format rules are unique per website,
a priority, assigning a precedence to determine which rule must be applied before another,
a criteria, to determine what fields and values must be found in ANS for the rule to be applied to the object
a format, describing the ANS fields to use, transformations to be applied to a field value, the order the fields are applied, and static characters that will be used in the URL.
The Canonical URLs service has a fallback format rule, triggered when no criteria in other rulesets match the content object needing a canonical URL. The default format rule does not have priority or criteria properties; it only has format.
The Format page lists and documents the transformation methods that you can apply to format rules.
A developer at a news organization wants to ensure that all video URLs start with /video/
so that PageBuilder resolvers can deliver the correct template when a video is requested. To accomplish this, the developer opens the Canonical URLs Format page, selects the active website, and adds a new rule with a priority of 1
and a criteria of {"type": "video"}
. They then copy the existing default format rule into a new rule's format field and prepend it with /video/
to enforce the desired structure.
To verify the setup, the developer pastes the ANS of a video into the testing format rule field and confirms that the generated canonical URL matches expectations. After the rule is in place, any newly published video automatically follows the updated format, with its URL beginning with /video/
while maintaining the rest of the standard URL structure.
Previously published video URLs remain unchanged unless the video is republished. When a video is republished, Arc XP regenerates the URL using the new format rule, ensuring consistency across all future video content.
Procedures
Format rules display on the page in a repeating series of forms where each form block describes one ruleset. Each block is updated independently of the others.
The form to add a new format rule is located after the forms for existing rulesets.
Navigate to the Canonical URLs app. The Formats page is opened by default.
From the top drop down menu, select your desired website. Your organization's default website is automatically selected.
Scroll to the Add URL Format section to add a new format rule.
Complete the following fields:
Priority - enter a number that assigns precedence order for the format rules, where 1 is the highest priority. When content matches two format rules, the rule with higher priority activates.
Criteria - enter a JSON object that defines which ANS fields trigger a specific URL format rule. The criteria field must contain only the essential fields and values needed to identify the target ANS documents. When an ANS document contains fields that exactly match the criteria's fields and values, the system activates a specific format rule.
Format - enter the rule that determines how the system generates a URL. The format combines ANS fields, formatting functions, and static characters. All ANS fields specified in the format must exist in the ANS content; if any are missing, the rule fails to generate a URL and interrupts the publishing process.
Click Update.
Format rules display on the page in a repeating series of forms where each form block describes one ruleset. Each block is updated independently of the others.
Navigate to the Canonical URLs app. The Formats page is opened by default.
From the top drop down menu, select your desired website. Your organization's default website is automatically selected.
Scroll down and locate the form associated with the format rule to edit.
Update the following fields:
Priority - a number to assign a precedence order for the format rules. Smaller numbers assign a higher priority than larger numbers. If content could match two format rules, the rule with the higher priority is activated.
Criteria - enter a JSON object that defines which ANS fields trigger a specific URL format rule. The criteria field must contain only the essential fields and values needed to identify the target ANS documents. When an ANS document contains fields that exactly match the criteria's fields and values, the system activates a specific format rule.
Format - enter the rule that determines how the system generates a URL. The format combines ANS fields, formatting functions, and static characters. All ANS fields specified in the format must exist in the ANS content; if any are missing, the rule fails to generate a URL and interrupts the publishing process.
Click Update.
To delete a format rule, Click the Delete button in the form block.
The default format rule is the rule that generates the URL when no other format rules match the content's criteria. To update the default format rule, follow these steps:
Navigate to the Canonical URLs app. The Formats page is opened by default.
From the top drop down menu, select your desired website. Your organization's default website is automatically selected.
Scroll to the Default Format field.
Update the Default Format field.
Default Format - enter the rule that generates a URL when no other format rules match the content's criteria. The format combines ANS fields, formatting functions, and static characters. The ANS fields in the format must exist in the content or the rule breaks and a URL is not generated, causing the publishing process to be interrupted.
Click Update.
You can test an ANS object to verify which format rules would be activated and what URL would be generated. Paste an ANS object in the testing form. Remove unnecessary fields, such as content elements, promo items, and additional properties. Keep only fields you expect to use in the criteria or format when generating the URL.
Navigate to the Canonical URLs app. The Formats page is opened by default.
From the top drop down menu, select your desired website. Your organization's default website is automatically selected.
Scroll to the Test URL Formats section.
Paste ANS content into the Test ANS Document field.
Click Submit button.
If the test is successful, these fields display information identifying which URL format rule was activated:
Generated URL - a read-only field, shows the URL created from the tested ANS.
Format Used - a read-only field, shows the combination of ANS fields, formatting functions, and static characters that comprise the format rule used to create the URL.
Criteria Match - a read-only field, shows the criteria object from the format rule that created the URL.
If the test can not generate a URL, an error message displays below the Generated URL field.