Craft & its Plugins | A transforming workflow
We like to think of Craft CMS as a Transformer (one with BumbleBee as his friend) and plugins as its Jet Pack. And every time we develop a plugin for Craft, it helps our Craft projects reach client’s expectations.
Craft is a powerful CMS and its developers have left a lot of scope for extensibility. Plugins do the things that Craft CMS cannot. In our workflow Craft plugins help us do more than what Craft can do.
Often our clients steer clear of plugin development because of the extra work and vulnerabilities it brings. That’s not the case with Craft plugins. You can read about plugin vulnerabilities in our Craft Vs WordPress blog.
Before diving into our plugin development workflow you should know about Composer and Pluginfactory.
Craft CMS 3 is highly dependent on the Composer for its development. Composer is a PHP package manager that helps Craft with PHP dependencies. Pluginfactory on the other hand is a different tool altogether it creates scaffolding for plugins. We use the scaffolding to configure our code in it.
After defining the need we get on to the business of building the plugins.
Craft documentation has a pretty straightforward approach to plugin development. Being big fans of Craft’s coding techniques we looked no further for inspiration. Our plugin development process is as simple as Craft’s.
Building “The Jet Pack” for Craft CMS
Image credit: pixabay
Nomenclature for the assembly
Like the parts of a Jet Pack, parts of the plugin should be named in a consistent format so that they can be identified easily. We follow the naming guidelines whether we’re naming packages or handles. It is safe and efficient to follow a particular nomenclature.
According to the Craft’s documentation-
- Plugin handle must have lowercase letters, numbers, and dashes. All in Kebab case
- Package name should have Craft- prefixed to it, after the ‘/’
Creating blueprint for “The Jet Pack”
Image credit: matej
Before we found out about pluginfactory, like every other developer we used to make our plugin structure manually.
Pluginfactory creates a skeleton for your plugin in just a few clicks. It is created by a Craft developer named Andrew Welch. The scaffolding on pluginfactory are made using the Yeoman generator.
Details needed to create the scaffolding
- API version
- Plugin name
- Initial version
- Plugin vendor
- Plugin author
- Author URL
- Github name
When the structure is ready we feed our code into it and voila! Our plugin is ready.
Installing “The Jet Pack”
Image credit: jaguarmena
Plugins are written as composer packages. For Craft to recognize the plugin we have to install it as a composer dependency of the project.
The installation depends on the nature of plugin whether it’s local or public. If it’s local we install it by configuring the composer.json and adding a new path repository record. The path must point toward the plugin’s root.
If a plugin is made for a public release then it can also be installed directly via composer. After registering the plugin as a new composer package on Packagist, a require package command in composer fetches the package and installs it.
Final word: Plugins are essential
Image credit: jaguarmena
Plugins are not a crucial part of a CMS but it sure is important to achieve something out of the box based on client’s requirement. We find plugins to be extremely powerful and time-saving. The most important function of a plugin is to eliminate tedious and repetitive tasks by automating it. Some examples might put its importance into perspective.
- SEO plugins make search engine optimization easier
- E-commerce plugins improve customer journey.
- Analytic plugins help with insights on page performance
- Text and image editor plugins provide rich editing functionalities
If you’re looking to transform your Craft CMS experience — visual or performance — then plugins can help. As for the development of the plugin, talk to us here.
By Evnisha Malani
About Galaxy WeblinksWe specialize in human-centric user experience design services to our clients across the globe. Our innovative ideas, creative designs, industry best practices, and processes help us improve user satisfaction and solve complex design problems. Contact us for a free consultation!
Craft is a mature and tested content management system. Airbnb, W3C, Netflix, PBS, Salesforce, Moz, and countless other brands switched to Craft CMS for redesigning…CMS Frontend Website Development
At Galaxy Weblinks, we build high-performing software solutions that help teams scale. And write about it in the process. You may have spotted us on…Best Practices Design Ecommerce Web
This article is an assessment and comparison of the popular content management systems WordPress, Drupal, and Craft. We’ll dig into each CMS platform’s features, ease…CMS
Developers use Text Editors, also known as code editors, for editing programming code. These editors basically contain features like quick navigation, syntax highlighting, automatic indenting,…App Developement Web
Your business is growing and your team is doing their best to meet the tight deadlines and increased workload. You may be exploring the idea…App Developement Web
Voice search is at its peak in popularity among millions of users. According to an OC&C Strategy Consultants market research, Voice Shopping is projected grow…Ecommerce Web
Hello (Inserts your First name), All of us have received emails/ sms notifications, social media ads, that are sharing offers and discounts on the products…Ecommerce Web
The recently released WordPress 5.4 ‘Adderley’ update has got a lot to look forward to! Since this highly popular CMS ditched its classic editor for…CMS Web
Today, websites are more than just a ‘set-it-and-forget-it’ proposition. They are marketing machines that help you get new customers and leads. You might be planning…CMS
Modern technology has two problems: Devices have too many integrated features and everything is smaller. A good implementation of more-than-what’s-necessary features can give some users…App Developement Others Web
What is common between Pinterest, Tinder, Uber, Trivago, and Airbnb? All these companies experienced a surge in their product’s performance, user-engagement, and conversions by going…Mobile PWA Web
Kotlin has emerged as both substitute and supplement to C++ and Java. In 2018, the language had over 96,000 repositories on GitHub and had already…App Developement Galaxy Apps Others Web
When you think of hotspots for tech, don’t zero in on Silicon Valley just yet. According to Expert Market, Boston is one of the top…Galaxy Apps Internet Marketing Others Web
The experience of Disneyland is always an awe-inspiring one. No matter how many miles you have walked, you are always up for another Pirates of…Galaxy Apps Others Product Development Web
Google Play set out many criteria in their app guidelines that you need to follow. These changes may cause some issues as you try to…Galaxy Apps Mobile Others Web
Leading the AR revolution, industrial enterprises are experiencing improved ROI through AR-optimized supply chain. Enterprise sector is using AR across other functions such as product design…AR Galaxy Apps Others Web
Apple in its annual WWDC made some game changing announcements like a new Mac Pro, an exclusive OS for iPad, iOS 13 release, new Apple…Apple Galaxy Apps Others Web
At the time of an unsuccessful product deployment, you might ask yourself. “What went wrong with the product delivery?” The simple answer lies in configuration…Galaxy Apps Others Product Development Web
You might be familiar with Murphy’s law which says ‘Anything that can go wrong, will go wrong’. Software isn’t immune to that. But that’s often…Galaxy Apps Others QA Web
When you look at the respective market share of both the CMSs, WordPress has a clear edge over Craft CMS with 81.9% market share to a…CMS Galaxy Apps Others Web
Angular 6, released earlier in May 2018 didn’t offer much improvements on the performance part. It was mainly focused on making Angular migration-friendly. Google dropped…Frontend Galaxy Apps Others Web
Magento announced that it is pulling the plug on Magento 1 in April 2017 at the ‘Meet Magento’ conference in Prague. The announcement caused a…Ecommerce Galaxy Apps Others Web
Building a WordPress website? The WordPress community provides you with plenty of options. You can either make an easy one using WordPress themes or a…Galaxy Apps Others Web Website Development
Facebook has finally decided to monetize WhatsApp. Earlier this month, on August 1, Facebook rolled its long-in-development WhatsApp Business API for medium to large businesses.…Galaxy Apps Others Web
Craft CMS’s consistency can be seen in its regular updates & latest features. Matrix is one of those early features that helped Craft dominate the…CMS Galaxy Apps Others Web
Before introducing the Debug Tool in Craft 3, Craft CMS made you install a separate web-based application, Web-Console. You could run shell commands on your…CMS Galaxy Apps Others Web
Investors have the money, you have the idea, and the right pitch is the only thing that stands between you and them. But, pitches are…Galaxy Apps Others Product Development Web
“Personal data shall be processed in a manner that ensures appropriate security of the personal data, including protection against unauthorized or unlawful processing and against…Galaxy Apps Others Web
Google recently announced Mobile-First Indexing after a year and half of extensive experimenting and testing. The search engine giant will start migrating sites that follow…App Developement Galaxy Apps Others Web
Social media networks are mode of social interaction. It is a platform of sharing and discussing information among human beings. Social media can include text,…Internet Marketing Social Media Web