开发者

How to modify js in contributed module in Drupal

开发者 https://www.devze.com 2023-03-29 23:21 出处:网络
I want to modify a javascript file bundled in a drupal contributed module a little bit, for example changing a specific #id to css .class etc. As far as i know it\'s not good to modify source code of

I want to modify a javascript file bundled in a drupal contributed module a little bit, for example changing a specific #id to css .class etc. As far as i know it's not good to modify source code of that modul开发者_开发技巧e for upgrade reason. So, can you pls teach me how to do that the best way?


If you can accomplish what you want in a separate .css file, that would be best.

If it's an improvement that would enhance the module, simply make the modification and submit the patch back to the community. The drupal site has full details on how to create a patch.

If the patch is very specific, see if there's a way to make it generic so that you can submit it.

If all else fails, and you have to make the change, COMMENT. It's also good to create a patch file with the change and save it outside of the contrib module directory. The whole reason to NOT make changes is that updates become a real pain. If you document every change you make, and feel confident that you can re-apply them, then you should be OK.

0

精彩评论

暂无评论...
验证码 换一张
取 消