Showing posts with label footer. Show all posts
Showing posts with label footer. Show all posts

Thursday 29 April 2021

How to load CSS or JS in footer?

If, we have to load CSS and JS in header or footer in Drupal 8, so we will call our CSS or JS in '*.libraries.yml' file, there we will use scope attribute for this purpose.

we just have to pass the option value either header or footer.

like: scope:footer  or  scope:header 

Example:

If our yml file is mytheme.libraries.yml and we are attached assets there..

slick_slider:

  css:

    theme:

      slick.min.css: { type: external, scope:footer }

  js:

    slick.min.js: { type: external, minified: true, scope: header }

  dependencies:

    - core/jquery


Note: If have any suggestions or issue regarding 'How to load CSS or JS in footer?' then you can ask by comments. 


How to resolve max execution time error in drupal ?

When you found error regarding 'max_execution_time' exceed, then you can follow steps for resolve this error: Steps:   You can put t...