-1

有没有办法在没有 Masonry 模块的情况下将Masonry jquery 添加到我的 drupal 主题中?只需将其添加到主题文件中。我正在使用 lexi 响应式主题。我想我必须将 masonry.pkgd.min.js 上传到已经存在的 js文件夹,将 scripts[] = js/masonry.pkgd.min.js 添加到我的主题的 info 文件并添加 width: 220px; 边距:10px;向左飘浮; 到我的 style.css 中的 .node 类,但在那之后......有人可以逐步指导我吗?

4

1 回答 1

0

另一个选项,您可以在 preprocess_html 挂钩下的 drupal 主题 template.php 中编写 PHP 代码

/* 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));
}

添加到模板文件后,清除 Drupal 缓存非常重要。

于 2013-08-19T13:41:09.197 回答