Please advise: identify document types in links

We would like to use %globals__asset_type:<assetid>% to identify document types in links. Mainly this would be for PDF and RTF files, but there will be other types such as various MS Office formats, images etc. This is so we can generate links automatically like this:


document name (PDF, 412 kB)



At the moment we use v3.16.4, and it does not have an asset type specifically for RTF files. Also the PDF asset type keyword replacement gives the text ‘PDF File’ where we would prefer to just use ‘PDF’. Presumably we need to create some custom asset types, so how can we go about getting this done?



It would also be helpful for morphing to these custom assets to be supported so that we can update existing assets e.g MS Word Document -> RTF, or PDF File -> PDF. type.



Kind regards,

Andrew

This might help, it’s how we ended up doing it. [topic=“4551”]Showing PDF icon and file size[/topic]


Thanks for the reply - it isn’t the sort of solution we had in mind though. We specifically need text links for accessibility purposes, and we can generate the sort of text links we want automatically e.g:

Asset short name (Matrix asset type, readable file side)
Framework for the collaborative development of broadband in Australia (PDF, 415,5Kb)

So the first line explains what’s being shown via keyword replacement, and the second line shows how it looks for an actual asset. Here’s the code used:

<ul><li>

Asset short name (Matrix asset type, readable file size)<br />

<a href="./?a=13716">%globals_asset_short_name:13716% (%globals_asset_type:13716%, %globals_asset_file_size_readable:13716%)</a>

</li></ul>

The problem is that we’re stuck with the names and types that MySource Matrix has e.g. ‘PDF File’ rather than ‘PDF’ and the generic ‘File’ rather than ‘RTF’. So anyway, back to the original questions: how can we get some custom asset types for different file types set up? Can we morph existing assets to the custom types?

No. Custom asset types needs to be created by a developer.



You can customise the listing's type formats and hard-code the file type in there. Just print PDF instead of the asset type keyword. You have to do it for each of the file types being listed, but there are not that many.


I think that creating custom file types is going to be a strange solution to your problem, if you all you are wanting to do is change some text. What about placing the PDF File keyword into a span with a specific class, and rewrite that text using javascript, which would be quite easy.