I have the following sample module that will add image let say that I have this view.tpl for my module file:
<span><img src="{$urls.base_url}modules/mymodule/views/img/google.svg" alt=""/></span>
and inside that mymodule path the google.svg's file is placed inside the folder themes/modules/mymodule/views/img/google.svg. The URL to the google.svg can be navigated as follow:
http://www.domain.com/modules/mymodule/views/img/google.svg
Now if I want to override the image using a child theme, I edited google.svg, saved it and then I copied the file into my childtheme. I copied mymodule to the childtheme modules the only thing different is I edited google.svg. So, I also have the same view.tpl taken from parent module as follow:
<span><img src="{$urls.base_url}modules/mymodule/views/img/google.svg" alt=""/></span>
And the MAIN issue here is the $urls.base_url variable above (inside child theme module) it points only to parent file of google.svg. It should point to the file inside the module from child theme that I have edited.
Perhaps there is a syntax of smarty that can point the URL for the image inside childtheme?
I tried to change the $urls.base_url to this $modules_dir/views/img/google.svg but this does not work.
What is more confusing when I read the documentation, it said that themes can override module's assets for CSS and JavaScript only. Does this statement means, we can only override these 2 types of files and it will not work with image type?
Edit: Changed title and add extra details