Jump to content

How to properly add an image in a template file (classic 1.7)


Recommended Posts

Hello,

 

We are using the classic theme for prestashop 1.7 as our theme base.

 

I want to hardcode an img tag into the footer.tpl template file (to show payment partners logos) but it actually doesn't work as expected (the image is never found).

 

I know that when you add an image in the _dev/img folder of the theme every image is given a hash-like name and referenced by this name in the final css file (computed by webkit). But it only works for css files.

 

So, what is the right way to add an image in the footer (or any template file) ?

 

Thanks, have a nice day :)

  • Like 1
Link to comment
Share on other sites

  • 3 years later...

I have found an answer in another post: 

The way I did, consider the image file is named my-image-name.jpg:

  1. Place the image in the /assets/img folder of your theme
  2. In your template, use this to display the :

    <img src="{$urls.img_url}my-image-name.jpg">

     

Tadaaa... problem solved!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...