Hello,
To have google news index your site and publish your news stories, it requires that each news story has a URL which contains a unique number consisting of at least three digits.
Is there any easy way to do this in matrix? Ideally it would be brilliant to be able to reference articles using the asset id in the URL somehow.
Aside from manually entering in another webpath/url for each article which would be very time consuming and difficult - does anyone know a way around this??
Thanks,
Oli
Hmm… interesting. About the easiest way to do this long-term would be to create a custom News Item asset that uses the asset ID to create its URL instead of the name.
I have added a Feature Request for this, but if you want to get it quicker, you might want to speak to Squiz Sales about funding this development.
Also, you could do this with triggers: There is an “add web path” trigger that could take %globals_asset_assetid% as a keyword. This will add the current asset’s asset ID as a webpath. Note that I haven’t actually tested this.
I’ve just prodded the triggers a bit. The problem is, you can’t remove the original web path, so I’m not sure which one Matrix will use when printing the content (usually the shorter of the two, if the rest is the same, so you’d think the asset ID would win).
Hmm… it seems my add web path trigger doesn't actually work – my keyword replacement isn't happening properly. We'll have to wait for a developer to come online. 
Not all triggers take global keywords. In fact, almost none do IIRC. Global keywords replace frontend content. Triggers would need to explicitly ask the keyword system to replace them, which this one obviously doesn't.
I can't think of an automated way to do what you are after.
Bum. Well, the feature request is in, so we'll see what happens with that, I guess.
Generate a dummy number based on Asset ID and attach it to the url.
The number would be something like: 00%asset_assetid% - guaranteed to be at least 3 digits.
If you list your news items using an asset listing, attach that number to the url like this
<a href="%asset_url%?uniq_id=00%asset_assetid%">%asset_name%</a>
Matrix doesn't need that number and will disregard it, while Google will be happy that it found something that has 3 unique digits or more.
This might not be a cleanest solution, but it doesn't require any development and can be done right away.
You'll have to watch out for urls that are of form xxx?a=YYY because appending another ?xxx=YYY would make it invalid. However, that's a different kind of exercise. I assume all your news items have nice readable urls.
Google needs the unique number in the URL, not in the GET parameters, so that option wouldn't work.
I disagree. GET parameters are considered part of the URL by RFC #1738 http://www.ietf.org/rfc/rfc1738.tx. Also, check out news.google.com to see quite a few articles whose unique identifier is in GET vars.
I was just going by the examples from that Google page, not the RFC itself. 
Thanks - that seems like a simple solution… should be a piece of cake to implement too!
Lateral thinking wins again!