Bulk change of type 2 link assets to type 1


(Jennifer Weiley) #1

I have created hundreds of link assets as type 2 as I thought I had to in order to hide them from turning up in search results. Turns out that the Resources environment for the site just had to be hidden from users.

The problem I have is that, as an admin, I can’t search the URLs that the link assets point to because they are all type 2. Doh!

Is it possible to bulk change link assets from type 2 to type 1? I’m thinking this might need development work to create a script or a painstaking session of one-by-one changes.

Squiz Matrix v5.4.7.1


(Harinder Singh) #2

You can use triggers to change the Links’ type. Try the following and see if it is resolving your issue.

http://www.zedsaid.com/blog/batch-change-asset-link-types-in-squiz-matrix-using-triggers

The only limitation I have found using trigger is that you have to set root nodes manually.

Note: Try to test this first before running trigger on large set of assets.


(Bart Banda) #3

Why does this depend on the link type? Do you mean you can’t search for them using a Matrix search asset? That shouldn’t matter… Not sure why you need to make them type 1 links in order to search for them?


(Jennifer Weiley) #4

Hi @Bart ,

That’s right - I can’t find any links via search. They are all Type 2 AND we have hidden the ‘Resources’ asset from search so that the raw asset doesn’t turn up in search results. But it means that when you are in Admin or Edit you can’t locate the asset through the asset finder in EditPlus or search in Admin.

So if I’m editing a page and want to link to an asset I have created for www.testurl.com.au, I go to the asset search and type in www.testurl.com.au and get zero results.

This is a major problem as we have hundreds of links built as assets. It’s one of the most genius features of Matrix but not being able to search means I have to scroll through the collection to find a link asset.


(Bart Banda) #5

I think I’m still not understanding how those links are excluded from the search? Are you saying you’ve set up rules in the global search manager to not include any link assets under the “Resources” section from being indexed? Because that’s the only way I can think of that those link assets wouldn’t show up in the Edit+ or Admin interface quick searches. Or perhaps there’s a bug in your version of Matrix that is causing that? Does searching for other asset types under that folder work? Maybe it can’t match on a domain URL as it has dots (.) in it? Have you tried searching for the link asset’s name rather than the URL?


(Jennifer Weiley) #6

Hi @Bart - search for the name or search for the URL for the link asset does not find the asset. I have to either scan the list visually - which is in alphabetical order - or search for the asset number, which is no use to my editors when they are looking for the link assets. So it might be the way we have hidden the resources location from search that has caused the problem.

When we first built the site, the link assets were turning up in search results on the public site so we hid the resources location from search to stop that. But now they are hidden from editors and admin too. I’m going to raise a ticket as it’s becoming a real problem as the site grows and as we use this technique on more sites.


(Bart Banda) #7

OK thanks Jennifer. Yes, raising a ticket sounds like the best path forward, as we’ll then be able to look into more closely and identify if there is a bug in your version of Matrix at all.


(Jennifer Weiley) #8

Hi @Bart - the response to the ticket I raised is that I can’t reliably search for links by the URL because search breaks up the URL on every punctuation mark (’/’ and ‘.’) and will throw out words under 3 letters long.

To find the link asset I need to:

  • search in EditPlus (so I don’t include my entire instance in the search)
  • use the link asset number (which I usually don’t know) or
  • use the asset name (which I usually know, but not always).

I might rename some of my link assets so they are more intuitive for content editors. And what would also help is to have a filter for link assets to help narrow down the search. (Add it to the wish list!)

Also, we’re on Squiz Matrix v5.4.7.1 and the ‘Link to URL’ field on the details screen is too small to show the whole of my URL, so I’m hoping the field is wider on the later versions so I can see a URL of 70 characters without clicking in the field, assuming that’s not too unusual. (Another one for the wish list!)

image