Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

プラグインのdefer対応 #1693

Closed
yama opened this issue Apr 29, 2021 · 0 comments
Closed

プラグインのdefer対応 #1693

yama opened this issue Apr 29, 2021 · 0 comments

Comments

@yama
Copy link
Contributor

yama commented Apr 29, 2021

概要

#1578
defer対応についてはすでに上記にissueが立っていますが、違う目線から提案します。

公開側配布テーマ(bc_sampleなど)のjQueryなどにdefer属性を付けると、動作しない
プラグインの対応を考える必要があります。複雑な話になりがちなので、baserCMSの
パッケージではそこまで考えないことにして、メールプラグイン・ブログプラグインなど
同梱の機能に関して、「jQueryなどをdeferで読み込んでも動作する」ようにするのが
分かりやすくてよいのではと思います。

具体的には、jQueryを必要とするスクリプトを外部ファイル化し、これをdeferで読み込みます。

<script>
let getTokenUrl = '<?php echo $this->BcBaser->getUrl('/bc_form/ajax_get_token?requestview=false') ?>';
</script>

値をPHPで動的に生成する必要がある時は、上記のように、そこだけインラインで
テンプレート中に書きます。

baserCMS version : 4.4.x

@gondoh gondoh closed this as completed in 4910dff Jun 21, 2021
ryuring pushed a commit that referenced this issue Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant