Jump to content

[SOLVED] Add custom assets (CSS, JS)


Recommended Posts

Hi,

I'm trying to understand how I'm supposed to add custom assets to a child theme. I followed the documentation but nothing seems to happen. 😕

assets:
  use_parent_assets: true

 css:
   all:
     - id: test
       path: assets/css/test.css

I tried to add the css part in theme.yml of the parent theme as well without success (I cleaned the cache after each update).

I would like to be able to add third-party libraries or my own file (CSS, JS) for all pages and for specific page as well. I'm already using custom.css and custom.js in child theme, those one work well.

Any help will be really appreciated, thanks!

 

EDIT

I found this old topic: https://www.prestashop.com/forums/topic/598436-how-to-add-custom-css-file-in-stylesheetstpl/

Cache is not enabled in my admin, neither CCC, I tried to activate/deactivate it, cleaned files under assets/cache but the test.css is still not loaded.

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

So I probably missed the last answer of the topic I added in EDIT in my first post.

Thank you @Velno ; this is working:

Quote

Solution for new versions of PrestaShop (working on my 1.7.6):

1. Simply add new styles / scripts as in the tutorial

2. If it won't work, go to: \config\themes\[your_theme] and delete file shop1.json. The file will regenerate after you refresh page.

That's it!

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 1 year 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...