Topic: MDB 5 Pro adding modules
wordfishgroup priority asked 3 years ago
Expected behavior
In your documentation for adding support of Pro features you give an example to replace mdb.min.js with Lightbox js file.
Step 4
Replace mdb.min.js with Lightbox js file.
<!-- MDB -->
<script type="text/javascript" src="js/modules/lightbox.min.js"></script>
Actual behavior
Instead of replacing js/mdb.min.js, shouldn't the required module be added as follows?
<script type="text/javascript" src="js/mdb.min.js"></script>
<script type="text/javascript" src="js/modules/lightbox.min.js"></script>
Or for WordPress (theme folder using assets subfolder):
wp_register_script( 'mdb.min.js', get_template_directory_uri() . '/assets/js/mdb.min.js', '', '', true );
wp_register_script( 'lightbox.min.js', get_template_directory_uri() . '/assets/js/modules/lightbox.min.js', '', '', true );
wp_enqueue_script( 'mdb.min.js' );
wp_enqueue_script( 'lightbox.min.js' );
Resources (screenshots, code snippets etc.)
https://mdbootstrap.com/docs/standard/getting-started/optimization/
Dawid Wajszczuk staff answered 3 years ago
Hi,
Everything is ok. If you import mdb.min.js
, there is no need to import lightbox.min.js
as it is already included in mdb.min.js
. This isn't done to gain functionality of Lightbox but to reduce the size of JS loaded to your page and optimize the loading speed of your site.
Keep coding,
Dawid
wordfishgroup priority commented 3 years ago
Thank you Dawid.
I understand that the PRO versions of mdb.min.js and mdb.min.css include lightbox and all the other pro specific resources.
On the documentation page I referred to, the objective is show how to optimize your resources. It shows a method to achieve this by using the free versions of mdb CSS and JS in your project and only adding the PRO modules that are used.
The free version of mdb.min.css and mdb.min.js do not include lightbox or any other of the PRO specific components. However, the page says to replace mdb.min.js with lightbox.min.js. This would only provide you with the JavaScript for lightbox and nothing else. The documentation should read:
Step 4
For your project, add the Lightbox JavaScript module to the free version of mdb.min.js
<script type="text/javascript" src="js/mdb.min.js"></script>
<script type="text/javascript" src="js/modules/lightbox.min.js"></script>
Dawid Wajszczuk staff commented 3 years ago
Hi. Thanks for your feedback. We will discuss this in team and consider changing it. Keep coding, Dawid
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 3.10.1
- Device: PC
- Browser: Edge
- OS: Windows 11
- Provided sample code: No
- Provided link: Yes