Additional URLs: Some questions I can't find answers to


(db) #1

Matrix Version: v 5.5.6.4 Edit plus. Browser access. Content Editor role.

Hi all,

Have been trawling documentation but can’t find the answers:

Q1. When we add an additional URL to an asset, how does Matrix determine the default URL?
It’s not alphabetical and does not relate to the order in which we assign the URLs. It appears Matrix just ‘likes’ one URL better than all the others.

Q2. Relatedly, how can we determine which URL is the default?
We want them both to work, but we have a preference for one over the other.

Q3. When we assign an additional URL to an asset that is an Excel file, the additional URLs disappear on Approve and make live.
That is: we add ‘contact list’ as a URL to an asset whose name is ‘…contact list as at January 2021’.
Our goal is to ensure there’s a stable URL irregardless of the date on the excel file (& asset name).
We’d like to retain the date of the Excel file, because if the user ends up with multiple contact lists on their hard drive, they can quickly identify the most recent file.
Alas, the URL returns a broken link whenever the page is published.
(Curiously, the additional URL is visible whenever we put the asset in Safe Edit mode, but disappears when the asset is live.)

Thanks in advance for your time!

db


(Bart Banda) #2

Hi db,

Q1. When we add an additional URL to an asset, how does Matrix determine the default URL?
It’s not alphabetical and does not relate to the order in which we assign the URLs. It appears Matrix just ‘likes’ one URL better than all the others.

It picks the best one based on the URL context it’s accessed. So for example if you have /about/asset and /business/asset, and you link to that asset from /business, it will pick /business/asset

If that can’t be determined, and the URLs are all based on the asset being under a single parent asset/path, for example if it has

url-1
url-a
url-22
url-33

Then it will pick the shortest one, in this case url-1 or url-a. It will pick between those 2 based on the order of the web paths stored against the asset, so if the above is the order in the web path field on the URLs screen, then it would pick url-1.

There is no setting on the URL screen that lets you pick a “default” one, but in some circumstances you can control which one you get if you are using a specific implementation to print the URL. For example, if you are listing a bunch of assets and want to control which URL you print for each one, you could use some SSJS to programmatically determine which url from the %asset_urls% keyword, which will return an array of URLs applied to the asset.

You can also create a metadata field that uses the first URL from that keyword array as the “canonical” URL and let editors overwrite it where needed, for example:

That sounds like the behaviour of the URL of the file getting the /__data/ URL once it’s made live and has unrestricted access enabled, see “Allow Unrestricted Access” bullet point under this section: https://matrix.squiz.net/manuals/core-assets/chapters/file#Details-Screen_details

We do have something in our backlog to be able to still serve files from their asset tree relative path instead of the /__data/ path even if file to be accessed without checking permissions, which should be available later this year.


(db) #3

Thanks, Bart. Appreciate your time.