{"id":2115,"date":"2019-04-09T09:37:07","date_gmt":"2019-04-09T09:37:07","guid":{"rendered":"https:\/\/mindfusion.eu\/blog\/?p=2115"},"modified":"2022-06-08T15:44:12","modified_gmt":"2022-06-08T15:44:12","slug":"using-mindfusion-javascript-components-with-wordpress-elementor-plugin","status":"publish","type":"post","link":"https:\/\/mindfusion.dev\/blog\/using-mindfusion-javascript-components-with-wordpress-elementor-plugin\/","title":{"rendered":"Using MindFusion JavaScript Components With WordPress Elementor Plugin"},"content":{"rendered":"<p>In this blog post we will describe the steps that are necessary to follow if you want to use MindFusion JavaScript library with <a href=\"https:\/\/elementor.com\">WordPress Elementor<\/a> plugin.<\/p>\n<p>This guide assumes you are familiar with Elementor. For clarity we will show you how to show the <a href=\"https:\/\/mindfusion.dev\/javascript-scheduler.html\">JavaScript Scheduler<\/a> from the <a href=\"https:\/\/mindfusion.dev\/products\/javascript\/scheduling\/samples#FirstSchedule\">\u201cFirst Schedule\u201d sample<\/a>. The steps can be repeated for any MindFusion JavaScript library.<\/p>\n<h2><strong>I. Add HTML Tag<\/strong><\/h2>\n<p>The Js Scheduler requires an element to be associated with. We create an HTML Elementor widget in the place of the web page where we want the schedule to appear. Then we write in it the HTML code that creates the calendar div:<\/p>\n<div id=\"calendar\" style=\"height: 100%; width: 100%;\">\n<div id=\"attachment_2126\" style=\"width: 1254px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/wordpress_elementor_plugin.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2126\" class=\"wp-image-2126 size-full\" src=\"https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/wordpress_elementor_plugin.png\" alt=\"Elementor HTML Widget\" width=\"1244\" height=\"884\" srcset=\"https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/wordpress_elementor_plugin.png 1244w, https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/wordpress_elementor_plugin-300x213.png 300w, https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/wordpress_elementor_plugin-768x546.png 768w, https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/wordpress_elementor_plugin-1024x728.png 1024w, https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/wordpress_elementor_plugin-422x300.png 422w\" sizes=\"auto, (max-width: 1244px) 100vw, 1244px\" \/><\/a><p id=\"caption-attachment-2126\" class=\"wp-caption-text\">Use the &lt;HTML&gt; widget of Elementor to insert code for the &lt;div&gt; element required by MindFusion JS Scheduler<\/p><\/div>\n<\/div>\n<h2><strong>II. Copy the JavaScript and CSS Files<\/strong><\/h2>\n<p>The First Schedule sample requires reference to two JavaScript files and a CSS file with the calendar theme.<\/p>\n<p>We copy the theme we will use in a new folder called &#8220;calendar-themes&#8221; into the directory of your WordPress website. This folder should be located in the subfolder that has the name of the WordPress theme you are using. This subfolder is located in the <strong>wp\/content\/themes\/<\/strong> directory. The path should be:<\/p>\n<pre>http:\/\/www.yoursite.any\/wp-content\/themes\/your-theme\/calendar-themes\/first-theme.css<\/pre>\n<p>Instead of \u201ccalendar-themes\u201d you can use any other name for your folder.<\/p>\n<p>Next, copy the <strong>MindFusion.Scheduling.js<\/strong> and <strong>FirstSchedule.js<\/strong> files in a new folder called \u201cjs\u201d, which is located at the same place where the calendar-themes folder is placed. The path should be:<\/p>\n<pre>http:\/\/www.yoursite.any\/wp-content\/themes\/your-theme\/js\/FirstSchedule.js\n\nhttp:\/\/www.yoursite.any\/wp-content\/themes\/your-theme\/js\/MindFusion.Scheduling.js<\/pre>\n<div id=\"attachment_2128\" style=\"width: 761px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/wordpress_files_upload.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2128\" class=\"size-full wp-image-2128\" src=\"https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/wordpress_files_upload.png\" alt=\"WordPress directory structure\" width=\"751\" height=\"654\" srcset=\"https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/wordpress_files_upload.png 751w, https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/wordpress_files_upload-300x261.png 300w, https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/wordpress_files_upload-344x300.png 344w\" sizes=\"auto, (max-width: 751px) 100vw, 751px\" \/><\/a><p id=\"caption-attachment-2128\" class=\"wp-caption-text\">The directory structure of a WordPress blog with the newly created &#8220;js&#8221; and &#8220;calendar-themes&#8221; folders.<\/p><\/div>\n<h2><strong>III. Get a Header\/Footer WordPress Plugin.<\/strong><\/h2>\n<p>Here is a list of the available options:<\/p>\n<p><a title=\"WordPress Header and Footer Plugins\" href=\"https:\/\/www.cminds.com\/best-5-wordpress-header-footer-management-plugins\/\" target=\"_parent\" rel=\"noopener noreferrer\">https:\/\/www.cminds.com\/best-5-wordpress-header-footer-management-plugins\/<\/a><\/p>\n<p>For the purpose of this tutorial we installed <strong>&#8220;Insert Headers and Footers&#8221;<\/strong> but any other plugin will do. After you install the chosen plugin add the reference to the scheduler themes and the JavaScript files according to the instructions of the plugin provider. In our case we did this from the WordPress Dashboard &gt; Settings &gt; Insert Headers and Footers menu.<\/p>\n<p>There we placed in the &#8220;Scripts in Header&#8221; text box:<\/p>\n<pre id=\"line1\">&lt;<span class=\"start-tag\">link<\/span> <span class=\"attribute-name\">href<\/span>=\"<a class=\"attribute-value\" href=\"view-source:http:\/\/ubydesign.net\/wp-content\/themes\/twentyseventeen\/calendar-themes\/first-theme.css\">http:\/\/ubydesign.net\/wp-content\/themes\/twentyseventeen\/calendar-themes\/first-theme.css<\/a>\" <span class=\"attribute-name\">rel<\/span>=\"<a class=\"attribute-value\">stylesheet<\/a>\"&gt;<\/pre>\n<p>And in the &#8220;Scripts in Footer&#8221; textbox:<\/p>\n<pre id=\"line1\">&lt;<span class=\"start-tag\">script<\/span> <span class=\"attribute-name\">src<\/span>=\"<a class=\"attribute-value\" href=\"view-source:http:\/\/ubydesign.net\/wp-content\/themes\/twentyseventeen\/js\/MindFusion.Scheduling.js\">http:\/\/ubydesign.net\/wp-content\/themes\/twentyseventeen\/js\/MindFusion.Scheduling.js<\/a>\" <span class=\"attribute-name\">type<\/span>=\"<a class=\"attribute-value\">text\/javascript<\/a>\"&gt;&lt;\/<span class=\"end-tag\">script<\/span>&gt;\n<span id=\"line346\"><\/span>&lt;<span class=\"start-tag\">script<\/span> <span class=\"attribute-name\">src<\/span>=\"<a class=\"attribute-value\" href=\"view-source:http:\/\/ubydesign.net\/wp-content\/themes\/twentyseventeen\/js\/FirstSchedule.js\">http:\/\/ubydesign.net\/wp-content\/themes\/twentyseventeen\/js\/FirstSchedule.js<\/a>\" <span class=\"attribute-name\">type<\/span>=\"<a class=\"attribute-value\">text\/javascript<\/a>\"&gt;&lt;\/<span class=\"end-tag\">script<\/span>&gt;<\/pre>\n<p>On our test blog we use the twentyseventeen theme. That&#8217;s how the Header\/Footer settings look like:<\/p>\n<div id=\"attachment_2131\" style=\"width: 987px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/insert_header_footer_plugin.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2131\" class=\"size-full wp-image-2131\" src=\"https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/insert_header_footer_plugin.png\" alt=\"Header\/Footer settings\" width=\"977\" height=\"886\" srcset=\"https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/insert_header_footer_plugin.png 977w, https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/insert_header_footer_plugin-300x272.png 300w, https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/insert_header_footer_plugin-768x696.png 768w, https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/04\/insert_header_footer_plugin-331x300.png 331w\" sizes=\"auto, (max-width: 977px) 100vw, 977px\" \/><\/a><p id=\"caption-attachment-2131\" class=\"wp-caption-text\">The header references the CSS theme of the calendar, the footer adds references to the required JavaScript files.<\/p><\/div>\n<p>Learn more about MindFusion JavaScript components at: <a title=\"MindFusion JavaScript Libraries\" href=\"https:\/\/mindfusion.dev\/products.html#javascript\">https:\/\/mindfusion.dev\/products.html#javascript<\/a><\/p>\n<p>For technical questions please use the MindFusion discussion board: <a title=\"MindFusion Technical Support\" href=\"https:\/\/mindfusion.dev\/Forum\/YaBB.pl\">https:\/\/mindfusion.dev\/Forum\/YaBB.pl<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog post we will describe the steps that are necessary to follow if you want to use MindFusion JavaScript library with WordPress Elementor plugin. This guide assumes you are familiar with Elementor. For clarity we will show you &hellip; <a href=\"https:\/\/mindfusion.dev\/blog\/using-mindfusion-javascript-components-with-wordpress-elementor-plugin\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[513,74,553],"tags":[557,558,555,556,80,554,560,559],"class_list":["post-2115","post","type-post","status-publish","format-standard","hentry","category-javascript","category-sample-code","category-wordpress","tag-elementor-custom-code","tag-elementor-external-files","tag-elementor-javascript-code","tag-elementor-widget","tag-javascript","tag-wordpress-elementor","tag-wordpress-javascript-code","tag-wordpress-load-external-files"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3RlKs-y7","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/posts\/2115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/comments?post=2115"}],"version-history":[{"count":13,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/posts\/2115\/revisions"}],"predecessor-version":[{"id":2779,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/posts\/2115\/revisions\/2779"}],"wp:attachment":[{"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/media?parent=2115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/categories?post=2115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/tags?post=2115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}