Globals asset attribute redirect url returns nothing

Hi,

We are using edit+ to create a link to a redirect asset. In the manuals it says

When linking a Redirect Page asset within the Edit+ for Squiz Matrix interface, using the Edit+ Editor, an additional Use Redirect Link Destination field will be displayed.

This inserts into the source <a href="%globals_asset_attribute_redirect_url:<asset ID>%" data-linktype="page_redirect">link text</a>

However, this keyword replacement doesn’t seem to be working rendered html is
<a href="" data-linktype="page_redirect">link text</a>

Is there a bug? or is there something extra we need to do to make this work as described in the manuals?

Matrix Version: 5.3.2.1

1 Like

That’s weird, should just work. You definitely have read access to that asset? And is the Redirect Asset live and publicly accessible?

1 Like

I’ve checked the various assets

  • standard page: it is live and has public read,
  • redirect asset live and public read
  • asset it is linking to (within the same instance of matrix) is also live and has public read.

Interestingly if the redirect asset has a url and not an assetID - then the keyword works as expected.

Hmm, does the asset you are pointing to have a URL on it?

What happens if you just print %globals_asset_url:% where asset ID is the asset your redirect page is pointing to?

Ok,

my redirect asset is (Id: #25684) %globals_asset_attribute_redirect_url:25684% produces nothing.

The location it is using is #22494 - %globals_asset_url:22494% produces the correct url.

Certainly seems odd.

Damn, I can replicate as well in latest 5.3. I’ve loged a bug report here https://squizmap.squiz.net/matrix/9914 and we’ll aim to get it fixed asap.

The following keyword alternative seems to work though: %globals_asset_assetid:9594^as_asset:redirect_url%

1 Like

I found when linking to a redirect link in edit+, once you select the link tool you then have to go into “find asset” and add ID this way, to get the extra option “Use Link Destination”. I find this impractical when you have a large site with redirect links sitting throughout and an asset listing to identify their asset id. I would prefer to type in the “redirect link asset id” and that option be available.

We’re changing that in 5.4 so that when you enter the ID in manually and if that ID is a link or redirect asset, it will automatically turn that option on. https://squizmap.squiz.net/matrix/9565

I know Bart has left, but hopefully someone at Squiz can respond.
This same issue where the Redirect URL will print using the keyword if a Location URL is entered on the Redirect Page, but will not if an Asset ID is used, is still present in Matrix 6.49.2.

I was able to cobble together a workaround in Server Side JavaScript (SSJS) using:
‘%’ + ‘globals_asset_assetid:’ + ‘%asset_assetid%’ + ‘^as_asset:redirect_url’ + ‘%’

But was this bug ever addressed in another way (a different Keyword maybe?), or was there a regression at some point which re-introduced it after it was fixed in another version?