Drupal-7 の swiper (v 7.x-1.4) モジュールのオプションを変更する方法を見つけるために、数日間探していました。ドキュメントは、モジュールがこのフックの使用をどのように期待するかを説明する泥のように明確です。スワイパー API から次のオプションを実装する方法に関する簡単なコード例を探しています。
autoplay
prevButton
nextButton
autoplayDisableOnInteraction
私が見つけた唯一のドキュメント リファレンスは、モジュールの README.txt からのものです。
...
You can also add, change and remove, any of API options of the Swipers,
just you need to implement a hook:
hook_swiper_options_alter($node, $plugin_options) {}
This way the module will handle pass these options to the script that
instantiates the swiper Plugin.
...
私は Drupal にかなり慣れていませんが、学ぼうとしています。これらのオプションを実装するための簡単なカスタム モジュールを作成しようとしました。モジュールを myCustom と呼び、次のファイルを含む /drupal/sites/all/modules/myCustom ディレクトリを作成しました。
myCustom.info:
name = myCustom
description = customize swiper
package = me
version = 0.02
core = 7.x
files[] = myCustom.module
myCustom.module:
<?php
function myCustom_swiper_options_alter($node, $plugin_options)
{
$plugin_options += (
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev',
paginationClickable: true,
autoplay: 2500,
autoplayDisableOnInteraction: true
);
return($node, $plugin_options);
}
私は複数の問題を抱えていることを知っています。Drupal は私のモジュールをそのまま有効にすることを拒否し、その理由がわかりません。admin->reports->recent log messages レポートを確認しましたが、少なくともトラブルシューティングに役立つものは見つかりませんでした。
これを修正する方法はありますか?このフックを機能させるためにコピーおよび変更できるコードの実際の例はありますか?
ご協力いただきありがとうございます。