Keyword

Attachments with image links...

  • Darren Forster
  • Darren Forster's Avatar Topic Author
  • Offline
  • New Member
More
6 years 11 months ago #165818 by Darren Forster
Attachments with image links... was created by Darren Forster
I think K2 is an amazing add on for Joomla and it's certainly working well on a few websites we've been hosting.

The only slight problem I've come across with it though is an issue with attachments and was wondering if there is any work around for it.

At some points on one of our sites we have pdf files for people to download. On the old site there was a preview image of the PDF which was linked to the PDF. The image was stored separately from the PDF.

I notice on K2 when you add an attachment it doesn't give you the option to add a "preview image" of the attachment. This would be quite useful, just wondering if it's possible in anyway?

The only one thing I was thinking of is to create a new item for each PDF file and attach the image to the image tab and then edit the template to link the two together, but is there a better way?

I presume actually turning the PDF into a preview image on the fly using PHP libraries would put a lot of strain on the webserver? There is one page where we have 3 monthly newsletters on it all going back to 2004 so I can imagine someone going on there it would generate a lot of PDF images in one go if we did it on the fly which would be a lot of strain for the server!

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 11 months ago #165935 by Krikor Boghossian
Replied by Krikor Boghossian on topic Attachments with image links...
Hello Darren and sorry for the late reply.

Another approach would be to separately upload the image in the form of eg: an extrafield and with some CSS presenting that field as a cover.

It is also possible to render specific fields by their alias in your overrides.

Example code:
github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php#L110-L116

github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php#L168-L173

More info on overrides:
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum