bolt-cms

Bolt CMS - Issue Linking Image Asset


I am fairly new to Bolt CMS and CMSs in general. I am getting the hang of twig and things like that and have implemented a lot of dynamic content now. I am however having an issue on my timeline page in linking image assets.

I have a content type called news which has an imagelist field. I need to be able to pull the image path from the content type but when I get the raw path (ie. "files/2018-06/image-name.png") and do nothing shows up. Is something wrong here? Is this an .htaccess issue?

I am open to any and all solutions. Let me know if you need more info.


Solution

  • If you have an imagefield in your record you usually can show the image with

    {{ record.image|showimage() }}
    

    or

    <img src="{{ record.image|thumbnail(320, 240) }}">
    

    For more information see: https://docs.bolt.cm/3.5/templating/twig-functionality#showimage and https://docs.bolt.cm/3.5/fields/image

    You can also look how it is done in one of the example themes.