Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

Drupal - Add external code into project

0 votes
32 views
added Aug 17, 2018 in Drupal by LC Marshal Lieutenant (17,110 points)

Add the following codes into yourprojectname/sites/all/themes/yourtheme/template.php

<?php 
// add font awesome css
  drupal_add_css('https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', [
    'group' => 'CSS_THEME',
    'every_page' => true,
    'type' => 'external'
  ]);
  // add material icon css
  drupal_add_css('https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700|Material+Icons', [
    'group' => 'CSS_THEME',
    'every_page' => true,
    'type' => 'external'
  ]);

  // jquery match height
  drupal_add_js(drupal_get_path('theme', 'yourthemename') ."/assets/js/jquery.matchHeight.min.js", [
    'group' => 'JS_THEME',
    'every_page' => true,
    'requires_jquery' => true
  ]);

  // js cookie
  drupal_add_js(drupal_get_path('theme', 'yourthemename') ."/assets/js/js.cookie.min.js", [
    'group' => 'JS_THEME',
    'every_page' => true,
    'requires_jquery' => true
  ]);
  
  ?>

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...