Forum Discussion

cjdinger's avatar
cjdinger
Leader
7 years ago

Customize the attachments preview appearance/behavior

Hi,

 

We're on the non-responsive skin, and the default appearance for message attachments is confusing to some of our users:

 

We would like to customize this to make it clearer what each action does, and maybe even add a third action: "preview as text".  (That one might be a stretch -- I know that Lithium is using the Box.com viewer to do the lightbox rendering.)

 

Imagine something that looks like:

 

-------------------

Attachments:

   filename1.ext [Preview] [Download] [Preview as text]

   filename2.ext [Preview] [Download] [Preview as text]

------------------

 

I'm not afraid of a little Freemarker to make this happen, but I'm not sure where to begin.  If I could get close with just CSS, I'm happy to do that as a start.  Elements include lia-attachment, lia-attachment-row-element, lia-attachment-link-row-element and a few others.

 

Thanks for any ideas,

Chris

  

 

 

  • cjdinger - 

     

    The easiest way to achieve this is using jQuery script. After the page load, update the filename text to preview and download icon text to download. 

     

    If you want to achieve this using freemarker,  You just need to add ?attachment-id=<attachment.id> after the message URL. However, it will reload the page after clicking on the URL.

    e.g <mesageURL>/thread-id/4?attachment-id=17