PricingBlog

File suffix icons

  • jubilant_courgette_93644-1279028364862033930

    Dov

    1 year ago

    Hi. I have a list of document filenames that I am displaying in a table.

    Is there an easy (and fast) way to display/render icons based on the suffix (eg pdf, txt, xlsx etc)
  • prettycold_-1279069615955120191

    Sam B

    1 year ago

    Probably have a column that uses a conditional and accordingly shows the appropriate image. Either you can store the image in some common place, or pick it up from another master table that has a file extension and corresponding image as 2 columns, and join using the extension. Sharing my first thought, may not be the best 😄
  • nocodeprocode-1279070141287759905

    NoCode ProCode

    1 year ago

    Hacky way for the frontend - the file URL will have the extension.

    If you use split in .” and combine it with the “last” filter you’ll get the file format and can set visibility in a condition on that 😉
  • jubilant_courgette_93644-1279072981749993534

    Dov

    1 year ago

    That all makes sense. I was wondering if there was an api - but that would be too slow.
  • nocodeprocode-1279075636819919002

    NoCode ProCode

    1 year ago

    You won’t need an api for that 😃