From c6b962df17312c8a6195885e81a0d82e34e1d7f9 Mon Sep 17 00:00:00 2001 From: Georgi Mateev <georgi.mateev@sgalinski.de> Date: Fri, 8 Sep 2023 20:13:34 +0300 Subject: [PATCH] [BUGFIX] Improve README.md --- README.md | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 4c9a3a2..cdb1ff4 100644 --- a/README.md +++ b/README.md @@ -26,20 +26,6 @@ plugin.tx_sgyoutube { } ``` -### JavaScript integration - -Note: You can still use the old implementation of the lightbox without the new lightbox by -importing ```youtubeLightbox``` instead of ```sgYoutubeLightbox```. - -Install the **project_theme_lightbox** extension and integrate it to your main theme. Import the -file ```sgYoutubeLight.js``` to your JavaScript and initilize it. - -```javascript -import SgVideoLightbox from 'sgYoutubeLightbox'; - -new SgVideoLightbox(); -``` - ### Registration for more than the free 10.000 quotas per day It's not 1 quota per 1 API call. Each API has its own costs, which can be seen in the link below. @@ -71,7 +57,28 @@ If the `?disableYoutubeCache=1` parameter is added to the URL, this cache will b You can use a different API key for specific sites. You can implement a TypoScript page uid check and just change the key from the "TypoScript integration" topic. -### Compiling CSS/JS assets +### Making changes in the JavaScript/CSS +We are shippning the extension with source files and already minified assets. By default +we the minified assets are loaded in the Layout, so that the extension works out of the box just with plug and play. +Should you want to change this behavior you can do to the following: + +- Override the layout file in TypoScript +``` view { + layoutRootPath = EXT:project_theme/Resources/Private/Layouts/SgYouTube/ + } +``` +- Remove the CSS or JavaScript loading code from the layout +``` +<div class="tx-sg-youtube"> + <f:asset.script identifier="sgVideoJs" src="EXT:sg_youtube/Resources/Public/JavaScript/Dist/main.bundled.min.js" /> + <f:render section="main"/> +</div> + +``` +- Import the CSS or JavaScript source files in your respective asset pipeline + + +### Compiling CSS/JS assets with SGC - Install the sgalinski/sgc-core library via composer - Add the sg-youtube extension paths in the .sgc-config.json -- GitLab