MaXi32 Posted December 5, 2021 Share Posted December 5, 2021 (edited) 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 Edited December 5, 2021 by MaXi32 add more details (see edit history) Link to comment Share on other sites More sharing options...
MaXi32 Posted December 5, 2021 Author Share Posted December 5, 2021 (edited) I have seen a 2013 post where @rethus has mentioned that we need change the asset path. This seems like a design flaw to me for 'overriding' modules and you have to change the original structure of the assets. He does not like it so do I. Edited December 5, 2021 by MaXi32 mentioning a name (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now