Jump to content

Problem with Child theme


SergMi

Recommended Posts

Hello,

I have problems with child theme, namely in main theme i connect two css file in template stylesheets.tpl, like this


<link rel="stylesheet" href="{$urls.css_url}responsive.css" type="text/css" media="{$stylesheet.media}">
<link rel="stylesheet" href="{$urls.css_url}fontello/css/fontello.css" type="text/css" media="{$stylesheet.media}">

After, when i create child theme via


https://devdocs.prestashop.com/1.7/themes/reference/template-inheritance/parent-child-feature/


Files responsive.css and fontello.css don't pull up from main theme, and try load from child theme.
Why it happend, how to make so that these files are loaded from the main theme?

Link to comment
Share on other sites

{$urls.css_url } is pointing to actuals theme CSS directory, not the parent one.  You can try to replace it by {$smarty.const._PS_PARENT_THEME_DIR_}assets/css or more simply put the exact path of your parent theme css dir there.

Link to comment
Share on other sites

Thank you for your reply .
to do it, need create template in child theme, i do not want do it,  in child theme just create theme.yml and preview.png and nothing more.
If do what you wrote main theme not load this files.
Need that to good work main theme and child.

Link to comment
Share on other sites

Are you using main and child theme in parallel? Then only hardcoding the path in the file would work. But no need for file in child theme in this case I think (anyway whats wrong about files in child theme - thought thats the only purpose of having a child theme)

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