Jump to content

CSS Child theme not loading


Recommended Posts

Hi,

I am trying to setup a child theme of Apparel free theme (from here) on Prestashop 1.7.5 but I am encountering a problem.

When I define my theme.yml as :

parent: apparel
name: child_apparel
display_name: Child theme of apparel's theme
version: 1.0.0
assets:
  use_parent_assets: true
  css:
    all:
      - id: custom-lib-style
        path: assets/css/custom-lib.css

It will properly load the parent assets but will never load my custom-lib.css file.

 

As the parent theme (Apparel) as already styles defined in a custom.css, if I rename my file from custom-lib.css to custom.css, my file is well overriding the one from parent theme.

But I can not use any other name for the file (in order to not overriding parent css).

Hope someone can help me !

Edited by robinvrd
Indentation writing mistake for path line (see edit history)
Link to comment
Share on other sites

20 minutes ago, fbenoist.com said:

hi 

There's an error in the configuration file on the path line... 


assets:
  use_parent_assets: true
  css:
    all:
      - id: custom-lib-style
        path: assets/css/custom-lib.css

 

@fbenoist.com If you are talking about the indentation, it is just a writing mistake on the forum. My file looks like what you wrote. (I just edited my post)

Edited by robinvrd (see edit history)
Link to comment
Share on other sites

  • 3 months later...

This is my theme.yml

parent: apparel
name: my_name
display_name: My shop theme
version: 1.0.2
assets:
  use_parent_assets: true
  css:
    all:
      - id: custom-lib-style
        path: assets/css/custom-lib.css
        priority: 1000

I had a problem extending templates though afterwards.

One of the prestashop help pages commented that if you are making more than a few changes, than a child theme is not the way to go, i reverted to start editing the original theme.

If you translated some sentences, these will also be reset by using a child theme, no clue why.. 

Example for template extending that didn't work:

{extends file='parent:_partials/footer.tpl'}

{block name='copyright_link'}
   some changes here
{/block}

 

Link to comment
Share on other sites

Thanks @pixelicous,

Until now all the edition I do in the child theme are working perfectly but thanks for the advice.

I tried to add priority but doesn't seem to change anything :(

parent: classic
name: foobar
display-name: Foobar
version: 1.0.0
author:
  name: "Foobar"
  email: "[email protected]"
  url: "https://foobar.com"
assets:
  use_parent_assets: true
  css:
    all:
      - id: test
        path: assets/css/test.css
        priority: 1000

I cleared the cache from the shop and the browser's one, I can see all other CSS files but still not the test one 😔 The test.css file is in themes>foobar>assets>css

Even if I tried to do the same in parent theme (adding a custom-lib.css file, uncomment the lines for it), nothing's happening so I might doing something else wrong. 🤔

Edited by Minsky_ae
Add other test description (see edit history)
Link to comment
Share on other sites

@Minsky_aeMaybe you are having a permissions issue on those files?

Not sure of your setup, i have direct control of my server, so i SSH in, maybe you start creating files that www-data user doesn't have access to?

Are you doing it all in the module folder, zipping it, then uploading it to prestashop? Thats what i tried doing.

Link to comment
Share on other sites

@Minsky_ae Not sure how MAMP works, never handled it myself but I understand the concept.

By permissions i mean filesystem permissions, maybe some files' permissions got created with a different user than the one MAMP/web server/app is running with, or folder permissions.

To be honest, try to read what prestashop official documentation wrote about child themes, if its more than a few changes you better yet just change the original theme.

I just automate everything in scripts, so even if the theme will be updated in the future and i'll want to update it, i will be able to run a script to change what i need.

 

Link to comment
Share on other sites

  • 2 weeks later...
On 7/16/2020 at 3:42 PM, Minsky_ae said:

Hi @pixelicous,

Thanks again for your help and advice!

About the third-party libraries or any custom CSS/JS file which didn't load, I found the solution on another topic. It was the shop1.json file which needed to be deleted: https://www.prestashop.com/forums/topic/1027309-solved-add-custom-assets-css-js/

Cool..i'd take a look at it.

Happy you found the solution! :)

Link to comment
Share on other sites

  • 2 weeks later...

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