Jump to content

Edit History

MaXi32

MaXi32


add more details

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?

image.png.5110451f5e564cd999927151bd82f4c2.png 

 

Edit: Changed title and add extra details

MaXi32

MaXi32


add more details

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 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?

image.png.5110451f5e564cd999927151bd82f4c2.png 

 

Edit: Changed title and add extra details

MaXi32

MaXi32


add more details and fixed title

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/glogo.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 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?

image.png.5110451f5e564cd999927151bd82f4c2.png 

 

Edit: Changed title and add extra details

MaXi32

MaXi32


add more details and fixed title

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/glogo.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 also have the same view.tpl taken from parent module:

<span><img src="{$urls.base_url}modules/mymodule/views/img/google.svg" alt=""/></span>

 

And the issue here is the $urls.base_url variable above points only to parent file of google.svg. It should point to the file inside the module from child theme.

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?

image.png.5110451f5e564cd999927151bd82f4c2.png 

 

Edit: Changed title and add extra details

MaXi32

MaXi32


add more details and fixed title

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/iqitsociallogin/views/img/glogo.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 also have the same view.tpl taken from parent module:

<span><img src="{$urls.base_url}modules/mymodule/views/img/google.svg" alt=""/></span>

 

And the issue here is the $urls.base_url variable above points only to parent file of google.svg. It should point to the file inside the module from child theme.

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?

image.png.5110451f5e564cd999927151bd82f4c2.png 

 

Edit: Changed title and add extra details

MaXi32

MaXi32

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/iqitsociallogin/views/img/glogo.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 also have the same view.tpl taken from parent module:

<span><img src="{$urls.base_url}modules/mymodule/views/img/google.svg" alt=""/></span>

 

And the issue here is the $urls.base_url variable above points only to parent file of google.svg. It should point to the file inside the module from child theme.

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.

 

×
×
  • Create New...