Feature Request - link to file from image block
Permalink
Hi there
From the image block, you can link to an external URL or another page. Would it be possible to make so that it can link to a file? (at the moment we're having to use a content block).
Also, I've noticed on some browsers adding a link to a page will add something like {CCM_BASE} (or something), but on others it will add a link ?cID= which is good as well but unfortunately the base URL is hard coded in.
Thanks!
From the image block, you can link to an external URL or another page. Would it be possible to make so that it can link to a file? (at the moment we're having to use a content block).
Also, I've noticed on some browsers adding a link to a page will add something like {CCM_BASE} (or something), but on others it will add a link ?cID= which is good as well but unfortunately the base URL is hard coded in.
Thanks!
Although not elegant or obvious, the 'External URL' can be aimed at a file on your own site.
Yeh I had thought of that however it's a little crude and if the filename were to change or file updated etc. Shouldn't be too hard to implement into core code if it's already in the content block I assume :)
I'm afraid the existing content block bares no resemblance whatsoever to the image block. I have already modified the core image block to add some features so perhaps I'll look into adding the file link today and see how it goes.
UPDATE: No matter how it's implemented, the link will break if you move or rename the file so I'm not sure I can overcome this natural consequence. If you change the location or the name of the file, you will need to edit the image block to change the link. You could link to a page which contains the link to the file if you think that would be more intuitive for your clients to update.
UPDATE: No matter how it's implemented, the link will break if you move or rename the file so I'm not sure I can overcome this natural consequence. If you change the location or the name of the file, you will need to edit the image block to change the link. You could link to a page which contains the link to the file if you think that would be more intuitive for your clients to update.
Thanks mhawke. What other changes have you made to image block? Would be intrigued to know how it goes with adding a link to a file from image block (I would have assumed it would be the same as copying the functionality of the 'Add link to file' button in the blue bar of content block and altering the db (possibly) structure of image block). Thanks v much!
RE: your updaate - It's a shame that for pages and files, it doesn't add something like {CCM-cID=142} or {CCM-fID=24} for pages and files respectively so that way it doesn't matter if the content/file changes filename or your site base is moved, it would always point toward a fixed ID. But hey that's probably quite complex and asking a lot, I suppose if I get time I may look into developing something like that but I see a new fully-inline RTE is coming with a later release of C5.
RE: your updaate - It's a shame that for pages and files, it doesn't add something like {CCM-cID=142} or {CCM-fID=24} for pages and files respectively so that way it doesn't matter if the content/file changes filename or your site base is moved, it would always point toward a fixed ID. But hey that's probably quite complex and asking a lot, I suppose if I get time I may look into developing something like that but I see a new fully-inline RTE is coming with a later release of C5.
I've just done a little work to add a target to the href so you can choose where to open the link. Pretty minor compared to adding file manager linkages. I'm afraid that the versioning of files means that the fID changes every time you update a file so your idea of a 'permalink' won't work unless you go outside the file manager such as this add-on:
http://www.concrete5.org/marketplace/addons/download_folder/...
or
http://www.concrete5.org/marketplace/addons/list-files-from-set/...
http://www.concrete5.org/marketplace/addons/download_folder/...
or
http://www.concrete5.org/marketplace/addons/list-files-from-set/...