Just wondering if anyone has come up with a way to make asset listings list files and pages alike.
Unfortunately using %asset_name% shows the filename of a file rather than the title, so when listing a combination of pages and files you end up with a bunch of ugly filenames where titles should be.
I tried %asset_attribute_title^empty%asset_name%% which obviously didn't work, but I'm wondering if anyone else has any tricks? I'd rather not have to create a custom type format for every file type I'm using if possible.
[quote]
Just wondering if anyone has come up with a way to make asset listings list files and pages alike.
Unfortunately using %asset_name% shows the filename of a file rather than the title, so when listing a combination of pages and files you end up with a bunch of ugly filenames where titles should be.
I tried %asset_attribute_title^empty%asset_name%% which obviously didn't work, but I'm wondering if anyone else has any tricks? I'd rather not have to create a custom type format for every file type I'm using if possible.
[/quote]
Hi Ash,
%asset_short_name% should print the friendly name of your file assets, will that work for your situation?
Casey.
As I know %asset_attribute_title% is not empty. If a file is uploaded without filling in the title, Matrix uses filename as its title. Go through each file to give the friendly name(title) or try below
%asset_attribute_title^replace:.pdf:%
This should strip off the file ext name but you have to group the files by type (doc, docx, xls, xlsx etc) then customise each type format. Unfortunately the underscores cannot be removed.
Or use jQuery to reformat the titles, Nic has posted the similar JS if I recall correctly.
Ah, fantastic. Short names are probably more appropriate in this case anyway. Neat trick, thanks.