This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

rafaelteboekhorst56221
rafaelteboekhorst56221

Helllo!

I am having a whole lof of pictures somewhere in the assets folder of my theme. Now I want to load these pictures dynamically per product on my landing page. The specific urls to each pictures are saved in a database. What I want to do is something like this:

<img src="{{assets/img/{{ record.url_to_image }} |theme}}">

But that does not work. So I tried something like this:

<img src="/var/www/html/october/theme/assets/img/{{ record.url_to_image }}">

That also did not work.

And then I also tried to load pictures form the full uri like this:

<img src="/var/www/html/october/theme/assets/img/123.jpg">

But that does not work either...arrr

What should I do? Any ideas?

Thanks!

Last updated

rafaelteboekhorst56221
rafaelteboekhorst56221

I found my solution:

<img src="/theme/assets/img/{{ record.image }}">

had to remove: /var/www/html/october

mjauvin
mjauvin

Better to use this:

<img src="{{ 'assets/img/' ~ record.image | theme }}">
rafaelteboekhorst56221
rafaelteboekhorst56221

alright! Thanks a lot!

1-4 of 4

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.