'broken' links report by asset listings


(Robin Shi) #1

It takes a while to rebuild the whole website but it's better not to freeze the content. With the most fancy feature of Matrix, we link over the assets so the editor can update the pages on the live site and the change will be brought to the new site. However sometimes we have to clone the assets over to the new site because of the restrictions (design override for example). Eventually we come into the case that how do we know, in the new site, all the inline links on all the pages are not pointing to the pages that only sits in the old site?
The broken link report cannot help much because those links are out-of-dates rather than broken.

Knowing little about DB, I made the report with asset listing pages. They are five asset listing pages, four of them are nested.

Here is the first asset listing, as the first level. It lists the standard pages whose inline links to be checked.

[attachment=572:first look.jpg]

The second asset listing has the dynamic root, list_current_asset_id, to lookup the tree to find "Bodycopy Container"

[attachment=574:3.jpg]

From what I find, the inline link is a notice link between the page asset and destination page's "Bodycopy Container" asset.

Then nest the 2nd asset listing into first one's 'default format' like below,

[attachment=573:2.jpg]

So far I've got "Bodycopy Container" for all the pages that the new site pages are linking to.

The third asset listing lookups further to find Bodycopy Container's Bodycopy

[attachment=575:4.jpg]

This is because Bodycopy Container is only linked to Bodycopy, it doesn't know which standard page it belongs to.

The fourth asset listing lookups further for the standard page.

[attachment=576:5.jpg]

Great, now I've got all the pages that the new site pages links to.

The fifth asset list is to check what sites those page are,

[attachment=577:6.jpg]



Run the first level asset listing, I now get the report like this (i use a parse file to get content text only)

[quote]page name|asset ID|URL|Site name1#site ID1|Site name2#site ID2|Site name3#site ID3|[/quote]

I use pipe "|" as delimiter, then i save the result into text and convert it into Excel Spreadsheet.



Please note that run this asset listing is taking a lot of resources, so better to break down to smaller nodes for a whole site.

5.jpg (293 KB)
4.jpg (311 KB)
3.jpg (311 KB)
2.jpg (80 KB)
first look.jpg (302 KB)
6.jpg (295 KB)