Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Content & Markdown

Thumbnails for odt files

Solved by pamtbaau View solution

Started by byache 5 years ago · 5 replies · 632 views
5 years ago

Hello,
I have saved my personal thumbnail for odt files :
'user/themes/quark/images/media/thumb-odt.png'
but the thumbnail which is displayed is the default one (with O,D,T in orange background).
I don't understand why ?
Thank you !

5 years ago

@pzul, First of all... don't make any changes in a downloaded theme!

Instead, create an inherited theme. If changing Quark itself, you will loose all changes when Quark gets upgraded.

We need a tad more information:

  • How do you display the thumbnail?
  • Where do you display the thumbnail?
  • What does the HTML look like?
5 years ago

My customisations are in the user folder.
I use this code in a md file :

lien vers odt

5 years ago

[lien vers odt](grille.odt?link&resize=50,50)

5 years ago Solution

@pzul, the following steps will replace the default thumb by your own custom thumb:

  • Extension 'odt' is not supported by default, so we need to tell Grav about it:
    • copy '/system/config/media.yaml' into folder '/user/config'
    • add the following snippet somewhere in the file. eg. right above 'doc'
      YAML
      odt:
      type: file
      thumb: media/thumb-odt.png
      mime: application/vnd.oasis.opendocument.text
      
  • Add your custom thumb PNG in '/user/images/media/thumb-odt.png
  • Add the following to your page (*.md)
    TXT
    ![My doc](doc.odt?link&resize=100,100)
    
  • Resulting HTML:
    HTML
    <a href="/user/pages/01.home/doc.odt">
    <img alt="My doc" src="/images/path/to/cached-thumb-odt.png">
    </a>
    
last edited 03/12/21 by pamtbaau
5 years ago

Thank you !
My png wasn't in the correct folder...

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Jochen, 8 months ago
6 96 8 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 184 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 147 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 61 1 year ago
Content & Markdown · by belthasar, 1 year ago
4 255 1 year ago