Making a Custom URL Link Attribute type for File Manager

Permalink
I'd like to make a custom URL Link Attribute type for the File Manager, so that if an image is clicked on when set up in a file set within any of the slideshow add-ons, it goes to the designated URL.

How can this be achieved. Has this ever been done? I've looked at Andrew's address example but a URL attribute would be less complicated.

 
jordanlev replied on at Permalink Reply
jordanlev
You can add a new file attribute to your site and edit that in the file "properties" from the file manager.

But the hard part is getting that to automatically be used in the slideshow block (or any block that wasn't built with this functionality in mind).

You could create a custom template for the slideshow block where you retrieve this attribute and output it, but this is going to require a little bit of coding.
Deladroid replied on at Permalink Reply
Deladroid
I would like to do this too. When using a file set in more than one place, it would be easy for my client(s) to set the attribute when uploading the images in the file manager, and then it automatically links to a url based on the custom link attribute set to the file. Would be a great feature when using sets, instead of setting individual images in the slideshow block.
jordanlev replied on at Permalink Reply
jordanlev
I have a tutorial/blog post that includes this technique for linking slideshow images to other pages:
http://c5blog.jordanlev.com/blog/2011/12/build-a-slideshow-block/...
Deladroid replied on at Permalink Reply
Deladroid
Thanks for the link. I read through it all and I feel it's too bloated for what I am looking to do. (Great tut though).

Shouldn't I be able to simply copy the slideshow block to my root Blocks directory, and edit the view.php file so that it's pulling the custom attribute (I created ink_url as a custom file attribute) and making it link the slideshow image?

My problem is simply not knowing the code or format to grab a custom file attribute and use it to link the image.
jordanlev replied on at Permalink Reply
jordanlev
It's easy to create an attribute for the files, but it is hard to modify the built-in slideshow block because the code is terribly messy and not easy to work with (as is unfortunately the case for many of the core blocks). In my opinion, it will be easier to build your own slideshow block using the tutorial I linked to above (because the code is much cleaner and easier to work with) than it would be to modify the built-in slideshow block.

Best of luck,
Jordan