Suggestion: ability to add a link

Permalink Browser Info Environment
Hi,
it would be grat to have the option to add a link to the image, pointing to an internal page.
What about creating a paid add-on with that feature?

Type: Discussion
Status: Resolved
okapi
View Replies:
A3020 replied on at Permalink Reply
A3020
This can be easily implemented by adding a file attribute with a page selector attribute type. If you then override the view.php, you can use the link that's connected with the image.
okapi replied on at Permalink Reply
okapi
Wow, fastest support ever...! :)

Thanks for the info! But that would mean that i would have to add a file attribute to each image of the chosen file set? And - wouldn't that interfer with the functionality of galleries (like Grid Gallery 2 for example)?
A3020 replied on at Permalink Reply
A3020
That won't interfere. You can create the file attribute yourself and name it like you want of course... (e.g. random_image_link)

I'd say that every image has a different link, so yes, you have to set the link for every image. If the link is the same for each image, I'd just create a custom template and put an a-tag around the image...
okapi replied on at Permalink Reply
okapi
Thank you so much, that helped my a lot!
okapi replied on at Permalink Reply
okapi
Unfortunately i got stuck with trying to insert the file attribute (link) into view.php.
I have created file attributes for all images of a certain set. Now i wonder how i can call them in custom view.php as a href="..."
May i please ask you for help one more time...?
A3020 replied on at Permalink Reply
A3020
Something like this:

<a href="<php echo $fv->getAttribute('random_image_link') ?>">img</a>
okapi replied on at Permalink Reply
okapi
Thank you, it works perfectly now!

concrete5 Environment Information

Concrete5 5.7.5.4

Browser User-Agent String

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.