Is there a way to add Masonry jquery to my drupal theme without Masonry modules?Just to add it to the theme files.I'm using lexi responsive theme.I think I must upload masonry.pkgd.min.js to the already existing js folder , add scripts[] = js/masonry.pkgd.min.js to the info file of my theme and add width: 220px; margin: 10px; float: left; to .node class in my style.css but after that...Can someone guide me step by step please.
Asked
Active
Viewed 309 times
1 Answers
0
Another option you can write PHP code in drupal theme template.php under preprocess_html hook
/* Theme Preprocessor */
function <THEME_NAME>_preprocess_html(&$variables) {
global $base_url;
drupal_add_js("<PATH_TO_JS_FILE>", array('type' => 'file', 'scope' => 'header', 'weight' => 5));
}
After adding to template file its very important to clear your Drupal cache.
![](../../users/profiles/1929115.webp)
Shankar Ganesh Jayaraman
- 1,058
- 1
- 9
- 20
-
no more error js/masonry.pkgd.min.js after many cache clear but nothing happens.I did css the teaser with witdh and float proprety but no masonry effect.bartik is the theme I'm working with - is easy to css and is very responsive unlike other themes. – Presley P Aug 19 '13 at 16:15