Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
特定のブロック モジュールに JavaScript ファイルを添付したい。を追加する必要があることはわかってdrupal_add_js()いますが、このコードをどこに置くべきかわかりません。
drupal_add_js()
シンプルなalert().
alert()
これをテーマの pre_process 関数に追加してから、Drupal の add_js および get_path メソッドを使用して正しい方向に向けます。
hook_preprocess_page(&$variables) { drupal_add_js(drupal_get_path('theme', 'THEME_NAME') .'/js/my_js_file.js'); ... }