Thursday, March 31, 2016

6 Tips to Get Past a Creative Block

Maybe you’re a graphic designer. Or you’re part of the creative workforce. Or perhaps you simply create on the side. Either way, if you find yourself producing innovative work on the regular, then you’ve definitely come face to face with the dreaded creative block.

So what do you do when you’re hard pressed to come up with anything clever and a deadline is looming? You might squirm, distract yourself with email, or drink an entire bottle of chardonnay hoping for divine inspiration (à la Michelangelo) but that won’t solve the problem. Better to learn some strategies that will help you over the hurdle and get your creative juices flowing again.

1. Nature nurtures (your creative side)

man vs. nature: A man in a wide open cool climate forest valley

Many of us live in cities and suburbs where it might be unrealistic to visit the “great outdoors” on a regular basis. But even if you can’t get to the beach, or the lake, or the mountains it still helps to get out to a park—or out for a walk for some fresh air, and a fresh change of perspective. Evidence points to nature being exceptionally helpful in freeing your creative mind. Green space has a calming effect on your brain, and this helps encourage creative ideas because your brain isn’t distracted by the fast pace of city life. In fact, the effect is increased when you avoid distractions like your smart phone and text messages. Which leads me to topic #2…

2. Kill the Internet!… If only for a few hours.

Laptop in the dark with an almost closed lid

Increasing evidence points to how smartphones, social media, and the internet have created more distractions in our lives, making it harder to concentrate on one task at a time and “killing our creativity.”

Filling your idle time with work emails and getting caught up on texts may feel productive, but the loss of free time can be detrimental to your imagination. Your brain needs time to unwind and be absent-minded in order to formulate fresh ideas. So, if you’re finding it difficult to follow through on the task at hand, do your best to avoid filling that time with status updates, or seeing what new Instagram posts are in your feed. Letting a wandering mind ruminate over an idea is key to sparking the creativity you seek.

3. Lie down. And try not to fall asleep.

[caption id="attachment_127361" align="alignright" width="400"]Illustration: Girl in onesie lying on her tummy. by Jj Duran[/caption]

The creative workforce does a lot of their work while sitting. Or increasingly at standing desks— or even while pedaling! But one doctor’s study has shown that many of our creative ideas actually come to us when we’re lying down. The study tested subject’s abilities to solve anagrams, those tricky word puzzles whose answer usually “reveals” itself to the observer in an “an ‘A-ha!’ or Eureka moment.” This notion may resonate with you, too, if you’ve ever come up with the solution to a tricky creative problem while in bed.

So, you may want to try lying down for a change in perspective when dealing with a creative block. Or, if you don’t want to be the oddball at the office lying under your desk, I suggest keeping your journal, drawing pad, Wacom tablet, musical instrument, or other preferred creative idea generator by your bed, ready for when creativity strikes!

4. Be a kid again!

[caption id="attachment_127355" align="aligncenter" width="900"]Little red riding hood dancing with wolf by Ava N Garda[/caption]

I know you have a job, and deadlines, and a hectic be-everywhere-all-at-once schedule, but it truly helps to turn off the logic of day-to-day thinking once in awhile and play! Playing helps free your creative mind from the reason and rigor of right-brain thought. When you play you’re often suspending critical judgement, and you’re able to approach ideas from a new, novel perspective.

In fact, companies like Google and 3M have also embraced the idea of whimsy in the workplace by creating offices that resemble classrooms and game rooms.

So what things can you do to let your inner kid out? Get out your old legos, or sit on the floor (for a childlike perspective) and doodle. Try learning a new instrument. Or a new language! Join an intramural sports team… Whatever it is, remember that the pleasure of the experience is important. So really, do what’s fun!

Continue reading %6 Tips to Get Past a Creative Block%


by Hilda via SitePoint

Lebowski Agency

Lebowski Agency

Subtle parallax effect in the universe background of this One Pager for Lebowski Agency from Sweden. Really like how they designed the team section names to look like a film poster.

by Rob Hope via One Page Love

How to Use PostCSS with Gulp

PostCSS has been gaining popularity rapidly for some time now. If you have not used it yet or don’t know what PostCSS is, then I suggest you take a look at this introductory PostCSS tutorial, which discusses the basics of PostCSS including how to install and run PostCSS with a quick overview of some plugins.

In this tutorial, I will show you how to use PostCSS with Gulp, the popular automation tool. Since this is not an introductory Gulp tutorial I won’t be covering the basics of Gulp. But for a quick refresher, you can check out this excellent article.

PostCSS website

[author_more]

Setting Up the Project

Before beginning this tutorial, you should have a project folder that you will work in. The folder should have Gulp installed and have two folders inside it with the names “initial” and “final” (or some other name of your choice). The folder called “initial” will have your raw and unprocessed CSS code. The “final” folder will have the processed files, ready to be used.

Before going any further, navigate to your project folder using the terminal and run the following command:

[code language="bash"]
npm install gulp-postcss --save-dev
[/code]

The --save-dev flag adds the plugin that you are installing to the project.json file as a dependency. This will be helpful in situations where you need to collaborate with others on a project. When other team members run the npm install command on your package, all the plugins will be installed automatically.

At this point your folder structure should be:

  • initial — The folder with your raw CSS files.
    • style.css — Unprocessed stylesheet that we will edit later.
  • final — The folder with processed CSS files.
  • node_modules — The folder with all npm modules.
    • gulp — Created when you installed Gulp.
    • gulp-postcss — Created after running the command above.
  • guplfile.js — Your Gulp file.
  • package.json — Your package.json file.

Installing a Plugin

Let’s install a basic plugin to get started. The plugin we are going to use is short-color. This basically extends the existing color property to also set the background color using a second value. Run the following command to install short-color.

[code language="bash"]
npm install postcss-short-color --save-dev
[/code]

You could also install both gulp-postcss and postcss-short-color at the same time using:

[code language="bash"]
npm install gulp-postcss postcss-short-color --save-dev
[/code]

After both plugins have been installed, you need to open up and edit the gulpfile.js file so you can start working with the plugin. We begin by including the following lines to enable both plugins:

[code language="javascript"]
var gulp = require('gulp');
var postcss = require('gulp-postcss');
var shortColor = require('postcss-short-color');
[/code]

Now, let’s set up a Gulp task to process our raw CSS file and create a production-ready stylesheet. Here is the code to do so:

Continue reading %How to Use PostCSS with Gulp%


by Nitish Kumar via SitePoint

Ruby Interview Questions: LRU Cache and Binary Trees

As we talked about last time around, most interview problems for software engineering positions across the industry concern algorithms and data structures. With a bit of practice, it is possible and reasonably enjoyable to tackle these problems in Ruby. We have covered some of the basics: linked lists and hash tables. This time, we'll go a bit deeper. We'll implement an LRU cache (and explain what that is) and also look into binary trees, all in Ruby.

Continue reading %Ruby Interview Questions: LRU Cache and Binary Trees%


by Dhaivat Pandya via SitePoint

AntiPatterns Basics: Rails Views

In this beginner-friendly series, we’re looking at AntiPatterns, which—as the name implies—represent pretty much the opposite of design patterns. They are discoveries of solutions to problems that you should definitely avoid.

In this article we’ll focus on the main View AntiPattern—PHPitis—and work through a couple of techniques to keep your views lean and mean. Having tons of Ruby code in your views is not only nasty but often plain unnecessary.

Topics

  • Rails Views
  • PHPitis
  • Extracting Helpers
  • Helpful Helpers
  • Forms
  • Partials
  • Conditional Content
  • Semantic Markup

Rails Views

Rails comes with ERb (Embedded Ruby) out of the box, and I think it’s not necessary to throw in cool view-rendering engines like Slim for our examples for now. If you think “convention over configuration” mostly applies to the model and controller layers, you are missing out on a lot of the goodies that make working with Rails so speedy and progressive. Taking good care of the view layer includes not only the way you compose your markup but also CSS/Sass, JavaScript, view helpers, and your layout templates. Viewed from that angle, it becomes a bit deeper than you might think at first. The sheer number of technologies which can be involved in creating your views suggests that care should be taken to keep things neat, clear and flexible.

Since the way we write markup and styles is a lot less constrained than domain modeling, you want to be extra cautious to keep things as simple as possible. Maintenance should be pretty much your number one priority. Since redesigns or design iterations can be more frequent than extensive changes to your model layer, preparing for change gets a whole new meaning when it comes to your user-facing layer. My advice: don’t necessarily build for the future, but also, by all means, do not underestimate the rate of change—especially if you have one of those “idea guys” who knows jack about implementations on the team. What I like about Rails’s approach towards views in MVC is that it is treated as equally important, and the lessons learned from the model domain were incorporated into the view—whenever possible and useful. Other frameworks seem to agree, since they integrated a lot of these ideas pioneered by Rails.

Since the last article was a bit more extensive, I chose this topic as a small breather. The following articles about Rails controllers and testing are again bigger in size. The AntiPatterns for views are not that many, but they are nevertheless equally important. We’ll focus on the main one, PHPitis, and work through a couple of techniques to keep your views lean and mean. Since the view is your presentation layer, maybe you should be especially careful to not create a hazardous mess. Let’s get to it!

PHPitis

Why do we have MVC in the first place? Yes, because the separation of concerns seemed like the most reasonable thing to do. Sure, the implementations of this idea vary a bit here and there, but the overall concept of having distinct responsibilities for each layer is the core motivation for building robust applications. Having tons of code in your view layer might not be alien to developers coming from the PHP side of things—although I hear their frameworks have caught up already (heavily influenced by things like Rails?)—but in Ruby-land these things have long been a loudly voiced AntiPattern.

The obvious problems like mixing responsibilities and duplications aside, it simply feels nasty and lazy—a little stupid too, to be frank. Sure, I get it, when you develop much within a framework, language or whatever ecosystem, it’s easy to become complicit or numb towards things like that. What I like about the people pushing Ruby is that these things seem to have a lot less weight—that might be a reason why innovating never seemed to be a problem within the community. Whatever works best wins the argument, and we can move forward.

So is this a whole section dedicated to bashing PHP? Not at all! In the past, PHP apps had the reputation of having weak separations between models, views and controllers (maybe this was one of the core reasons why people felt writing apps with Rails was much more appealing). Having single files with code for all three layers didn’t seem that sexy. So when we stuff tons of Ruby or domain code into our views, it starts to look like the dreaded PHP style of structuring things—PHPitis. Only a few things are as bad as this when it comes to developing web apps, I feel. When you care about happy developers and your own future sanity, I can’t see why anyone would go down that road—there’s only pain ahead, it seems.

Rails offers a lot of goodies to minimize code in the view as much as possible. You must learn the ways of helpers, layouts and preprocessors in order to achieve a cleaner view. A simple rule of thumb is to keep domain logic out of your views—no shortcuts!

The price to pay for being lazy on this is hard to overestimate. The Ruby code that must be in the presentation layer should be as little and as simple as possible, as well as intelligently organized. Your reward will be code that is a joy to extend and to maintain, and new team members will also have an easier time wrapping their heads around the new codebase. As a bonus, neat freak designers who code also won’t be angry and hide rotten food in your salad if you keep tons of Ruby code out of their markup.

Helpful Helpers

Knowing the myriad of helper methods in Rails will significantly improve the quality of your presentation layer. Not only will it clean things up and inject the occasional speed boost in productivity, but more importantly it helps you fight PHPitis.

The thing that you should appreciate about these helpers is that they represent extractions from commonly needed code. Instead of reinventing the wheel, when in doubt, check if there isn’t already a helper around that solves your issue in the view—the same goes for Models and Controllers as well, of course.

Here’s a list of helpers you should look into pretty much right away:

  • form_for
  • Other helpers for forms.
  • fields_for
  • link_to
  • content_for
  • And writing your very own, of course.

Forms

Let’s have a look at form_for first. I know forms are a little bit boring and not that sexy for a topic, but I highly encourage you to read up on them to familiarize yourself with the finer details. It’s important to understand how they work. I remember often just glancing over them without giving them much attention. Sure, you can get them to work quite easily without understanding what’s going on under the hood. In the future, I might take the time to write a complete article on them. In the meantime, I highly recommend that you spend a little time checking the documentation–at least you‘ll appreciate how convenient Rails makes it to deal with form stuff.

The Ugly

The example below shows you the HTML of a little form we need for creating agents. It only accepts three parameters as input: name, number and licence_to_kill. A lot of code for this little task, actually. The authenticity_token comes from Rails–it’s a security thing that protects the app from “cross-site request forgery”.

some.html.erb

Writing a form by hand is not only lengthy but error prone as well. Also, if we approached it that way, we’d also have to solve the issue with the varying routes and CSS classes that we might need for creating a new object and updating an existing one—in effect, we would need to duplicate forms to create and edit records. As you’ll see soon, Rails meets you more than halfway on that. Verdict: however you put it, the manual approach is nasty and lacks convenience.

The Bad

We could go down the following road, which does not make perfect use of conventions in Rails. Heads up, don’t do it. It basically shows that you’re not handling the available tools to your advantage and you are duplicating the form for new and edit actions.

some.html.erb

What happens here is that the form builder carries the model you need for the form.

Behind the scenes, the line above gets expanded into the following:

The form_for method takes a couple of arguments:

  • a symbol or a string for specifying the object
  • a url hash
  • an html hash
  • a namespace hash

The url hash is for specifying the routing options. That means that you can manually specify to which routing path you submit the form—named routes come in handy with this. This style is called the “generic way” because you need to manually configure the form_for call.

Why is this solution suboptimal? Because we want to keep business logic out of our Views and Controllers as much as we can. A side effect of that is that we need to change fewer parts when needed.

HTML

In case you missed it, this approach did not provide us with ids and classes for the form tag automatically. The ones for input tags, however, were generated for you. We’ll fix that in a minute. Just know what you can get for free and that you probably should use this to your advantage. If you need something different or an additional namespace, you can use the html hash or the namespace hash to specify things a bit more.

some.html.erb
HTML

Not bad! Now the form tag has the specified class and id—whatever makes your blood flow—and the input tags are namespaced with mi6. Almost there.

The Good

This one is called the “resource-oriented style” and has the least amount of Ruby you need to write in your views. With that approach, we want to rely on automated resource identification. Rails figures out which routes it needs based on the object itself. Not only that, it gives you a different HTML output for creating a new object or for editing an existing one. Behind the scenes, Rails just asks the object if it already exists and acts accordingly.

Creating forms this way is a clever use of conventions and helps avoid duplication. One line and all the heavy lifting is done for you.

some.html.erb

Much better, isn’t it? Now we get exactly what we need for both existing and new objects. Also, we didn’t need to add text to our submit button. Rails took care of that and also adapts to new or existing objects.

HTML for a New Object
HTML for Editing Objects

When editing objects, it is also reflected in the HTML output by adding the id to the form id and the route or action needed for updating a specific object.

A word about Rails magic. When people argue in exactly these situations that Rails is too magical for their taste, I often think that this could simply mean that they haven’t spent enough time learning the tools of their trade. Once you take the time to master these tools, you’ll often understand why a simplification or extraction was made, and they also appear a lot more sober and straightforward.

Attention!

The code examples above used form_object as a block parameter. This is not recommended best practice but was done to remind you what this object represents and what gets yielded from form_for. Most people just use a plain |f| or |form|, which looks much nicer and more concise.

By the way, things like label, text_field, check_box and the like are just helper methods that are called on the form builder object. There are a ton of them which cover pretty much any possible need you might encounter.

some.html.erb

Concise and reads nice, right?

Partials

Collections are another thing we don’t want to be too verbose about. Rendering partials for individual objects of collections is so concise and straightforward—if done right—that I feel you have very little excuse for not making use of Rails conventions to reduce Ruby view code.

Let’s turn things around with this one and start with an example that shows you how you are encouraged to approach this. Along the way, I’ll explain what you can leave out as well.

The Good

app/views/agents/index.html.erb

The render method is quite smart. The line above is all you need to write for iterating over a collection. If you need to change something in this view, it will be a very small change—and therefore a small cause of error.

What happens here is that the framework is able to determine which partial it needs. Through the name of the object, it knows where to look for the partial—given that you adhere to the conventional naming of things. The way I see it, this is a good example of how Rails is not trying to impress you with wizardry. The Rails team works hard to make your life easier by cutting through repetitive red tape of sorts.

app/views/agents/_agent.erb

The only other thing that is necessary to make this work is to place a partial template at the appropriate path in your object’s directory and extract the attributes you need from the object. No need to write any loops on your own. It’s fast and easy, handy and pragmatic, I’d say.

This extraction was originally done because the name of the partial was most of the time the name of the iterated object anyway, and so it was easy to create a convention that handles this common task more effectively.

The Bad

OK, now that we know how to handle this, let’s look what you could and should avoid. The example below is just a bad usage of Rails, but I wouldn’t call it ugly this time.

app/views/agents/index.html.erb

You get the same result as above, but it’s definitely more verbose. Iterating over the collection in the view is not necessary anymore. When you use render as above, the block parameter agent is implied, and you can just use it without the each loop. So stay away from code like this—it does not make you look particularly good (but nobody will collect your head for it either). It’s just not elegant and adds to the PHPitis.

Extracting Helpers

The most obvious solution for cleaning up code from your views is to avoid writing any or to extract them intelligently. Let’s say we want to scramble the names of our agents in the index list. We should not put this code directly in our views. If we decide that the model is also not the appropriate layer to place this, then a custom helper in the app/helpers directory might be the right choice.

app/helpers/agents_helper.rb

By packaging this in a module inside the helpers directory, we now have access to this method in our views. Please give specific helpers their own home, and don’t put everything on ApplicationHelper (app/helpers/application_helper.rb), which is really meant for more “global” stuff.

Now I can access this little fellow in my partial template—or any view—for rendering my collection of agents.

app/views/agents/_agent.erb

Your own custom helpers are a great way to keep your views clean and healthy. And as you have seen, it’s so quick and easy that there’s little excuse to be too lazy and not extract them for battling PHPitis.

Conditional Content

The helper method content_for is a handy tool for extracting content that doesn’t really fit the bill for a partial but needs a bit of encapsulation. It’s a way to store a bit of markup that you can apply on a page-per-page basis—you yield it into the layout where needed. In size, it should be a lot smaller than partials or even layouts.

This technique can also save you the step of creating your own method for it. Navigational menus or sidebars are often examples where this helper becomes useful. Let’s say you want to have a spot in your menu that is only for admins, but you don’t need to adjust the whole layout. Or you have pages where the sidebar is not needed. With content_for, you inject what you need where you need it on a page-per-page basis. Duplication no more!

app/views/agents/index.html.erb
app/views/layouts/application.html.erb

Aside from the fact that this header is a good candidate for extraction into a partial, look at the yield :double_o_navbar section. This is a yielding region that inserts code from a content_for block. It will only insert code if the symbol names match. Here we want only double-o agents to have access to certain links in the navbar. Everyone else sees just Home and About. Think about the special links an admin needs to see that should never face a public interface.

You can also use this helper to insert id or class attributes on HTML tags if needed. Every once in a while this comes in handy.

Another common use is populating the <title> of a page dynamically with a content_for block.

app/views/layouts/application.html.erb
some.html.erb

You just place the title you want in a content_for block and the application layout will insert it for you. You can get more clever with it, but that should suffice for now. Should you have no need for a title or forget to add one, then the logical || will kick in and yield a default of your choice. In the example above, we need to check for the presence of a title or the default won’t work.

What you definitely don’t want to do is create instance variables for that kind of thing. Single responsibilities, remember?

One more thing: you can ask if pages have a content_for block.

app/views/layouts/application.html.erb

This can help you avoid duplicating markup that is relevant to styling a page which adapts if elements are present on a page or not.

Semantic Markup

This is stuff you definitely want to avoid.

The markup above is from the bootstrap documentation and specifies how the columns are supposed to ‘look’—information that has no semantic meaning and actually belongs in your stylesheets. That’s the stuff designers have nightmares about.

So what’s the deal with that? This is important because—besides the questionable naming of classes—unsemantic markup violates separation of concerns. Your markup should not be bothered with styling information; instead, both should stand on their own and enable you to switch out styles effortlessly—without touching your HTML. It’s not as difficult as it might sound at first. It takes a bit of discipline, though.

When you are able to keep that styling information out of your markup, you have effectively reduced PHPitis on another front—for designers an essential one! Also, the use of generic divs without inherent meaning is another example of poor markup. HTML5 gives you lots of useful elements that convey more information to your future self, other developers, and search engines. Naming is supposedly hard, but HTML5 provides you with lots of semantic elements that make your options much easier in that regard.

Final Thoughts

I hope you have seen that Rails Views don’t need much love to shine. Developers can be a bit snobby about the front-end layer. Dealing with markup sometimes seems to be a little beneath them—writing HTML, DUH! Well, I shouldn’t throw any stones, but I came to appreciate a fine-tuned, well-honed presentation layer. It makes it much more fun to work with and, when done right, much faster to make the inevitable changes. Parsing tons of Ruby code mixed with badly written markup is not a fun experience in my book.


by Ed Wassermann via Envato Tuts+ Code

Hey, It’s Your Six-Figure Salary Calling

Hey, it’s your six-figure salary calling

If you’re looking to move to a job that offers stability and a often a six-figure salary, look no further than the industry with one million job openings in 2016, according to a Cisco report. Cyber security is the place to be—and we’ve got a deal that’ll help you get there. Get the Cyber Security Hacker & Penetration Testing Certification Training for $39.

This training helps you dive right into cyber security and penetration testing, with 117 classes and 20+ hours of content covered security code, web-based vulnerabilities, cross-site request forgery, and all the other essentials hiring managers want to make sure you’re familiar with. You’ll get lifetime access to the video lessons, exercises, quizzes, and assessments, and there’s even a discussion forum if you get stuck.

You dream job awaits. Get the Cyber Security Hacker & Penetration Testing Certification Training for $39.

Continue reading %Hey, It’s Your Six-Figure Salary Calling%


by SitePoint Offers via SitePoint

What Is Joomla?

Such is its popularity and usefulness over the last decade that Joomla! is considered one of the top-ranked open-source CMSs across the globe at the moment. Since its inception from the Mambo CMS, over the last ten plus years, it has improved so much that it’s no wonder that there are plenty of awards in its kitty already and still counting.

Specifically, if you’re in the field of web development, no matter the technology you’re dealing with, it’s impossible to get away from the word Joomla! If it’s so, I’m sure that you belong to some other planet! It may sound a bit overwhelming, but I can assure you that it’s something more than worth looking at if you haven’t done that yet for your next content management solution. In fact, it’s more than just a CMS—we’ll discuss later in this article what Joomla! is capable of.

In this article, we’ll thoroughly discuss what Joomla! is and how it could be useful for your web-based projects. Starting with a glimpse of the basic CMS, we’ll go through the features of Joomla! throughout the article, and in the last section I’ll leave you with some useful resources with references.

What Is a CMS?

A content management system, referred to as a CMS, is a system that allows you to manage information easily and effectively. The information could be anything, whether it’s a simple article or a complex media management system. The goal of a CMS is to provide an effective workflow which depicts the clear state of an entity at any given point in time. In simple terms, it allows information to pass through different states like draft, review, editing and publish.

Specifically, it’s non-technical users who love to have such a system at their disposal that allows them organize content easily and makes the whole process joyful rather than hectic. In any web-based application, there are three basic operations, which most of the time the administrators find themselves doing, performed on any given entity—add, edit and delete. And that’s what a CMS is designed for. Whether it allows you to do that by providing a WYSIWYG editor, inline editing or some other fancy goodies, the idea is to make the whole process effortless.

It’s not just the organization and management of content, but how good it is at providing granular access control to different groups of users, that's considered as one of the premium features of any CMS. It’s obvious that you would like to split up the responsibilities across different roles like author, editor and publisher. The provision of content versioning is also something you would like to keep your eyes on as it allows you roll back articles if things don’t go as expected.

In its most basic form, the typical workflow of any CMS could be something like:

  • The author starts a conversation by creating an article, and the default status of an article is draft at this point in time. Usually, it takes a couple of iterations for an article to get switched from draft to review status.
  • The Reviewer is granted permission to access all the articles having status set to review. Again, it takes a conscious effort from the reviewer to go through them and forward them to editors if they meet certain guidelines that are a must for an article to switch from review to editing status. Of course, the reviewer could send them back to draft status by leaving appropriate comments if an improvement is expected from the author.
  • Going through all the articles in editing status and beautifying them with final touches is something expected from the Editor in their day-to-day routine. Also, they are responsible for pushing content from editing to the publish queue.
  • Finally, it's the job of the Publisher to make sure that the content sitting in the publish queue gets the proper treatment by scheduling their publishing in the front-end.

Generally speaking, what we've listed above is one of the most simple yet effective use-cases one could adhere to. Not to mention that in the real world you'll witness more complex workflows accompanied with rich features like tagging, social sharing, and commenting, to name a few.

So, that's a quick and hopefully useful introduction of what a CMS system could look like. From the next section onwards, we'll focus on the main subject of this article, Joomla!, which is something I promised we'll explore throughout this article.

Joomla!—an Award-Winning CMS

Since its inception back in 2005, Joomla! has evolved over the years, and the end result is one of the most powerful and feature-rich CMSs, downloaded by millions of users. As they say, it's truly a community-based CMS, run by and for the community! For any open-source project, as with Joomla!, the support from community members is an important factor in the persistence and sustainability of the project.

Joomla! is built using some of the most widely used web technologies like PHP, MySQL and Apache. Having said that, it's not just limited to the aforementioned technologies—it also supports other popular databases and web servers. You could choose from either SQL Server or PostgreSQL instead of MySQL database engine if you prefer to do so. On the other hand, Microsoft IIS and NGINX are candidates for the choice of web server along with Apache.

For developers, Joomla! is built using the MVC design pattern, a popular pattern used by plenty of other frameworks already. Although discussion of the MVC design pattern is something out of the scope of this tutorial, it provides a separation of concerns, thus allowing the developer to concentrate more on development rather than worrying about how it would look in the front-end.

It's no surprise that the latest major version of Joomla! is responsive out-of-the-box and mobile-first, as it's impossible nowadays to ignore that, and it could be costly for any framework that did so. As of writing this, Joomla! 3.4.x supports PHP 5.5+ version but not PHP 7. However, the release of the much-awaited version Joomla! 3.5 is around the corner, and it claims to support PHP 7, which will be a huge performance boost natively, if experts are to be believed.

So, if that was a high-level overview of what Joomla! is all about, the following list highlights some of the concrete features you've been waiting for, which ship with the Joomla! core itself.

  • out-of-the-box content management features
  • content organization using nested level of categories
  • content versioning and tagging
  • media management
  • user management
  • powerful ACL (Access Control Lists) system
  • smart search feature for site wide free-text search
  • RSS Feeds
  • multilingual features
  • responsive and mobile-friendly interface

Of course, it's impossible to discuss each and every feature in detail in a single article, so for those curious users I'll leave some useful resources at the end of this article.

Joomla!—Beyond the CMS World

You’re on the wrong side of the table if you believe that Joomla! is only useful for content management, as you’ll be surprised to hear that there are more than 7,000 extensions available on the official JED (Joomla Extensions Directory) site, providing features that range from a simple image gallery solution to a full-fledged booking and reservation management system. In fact, there is a strong possibility that the extension you’re looking to develop on your own is already available on the JED!

The extensible architecture of Joomla! makes custom extension development a breeze. Are you looking for a system that serves as a blog? Maybe your new venture requires that you build a new YouTube kind of system, or you’re trying to build the next Facebook! The JED provides extensions for each of the aforementioned requirements.

Let’s have a glimpse of the luxury you could have if you choose Joomla! as your solution:

  • a full-fledged media management system
  • e-commerce solutions
  • portals with community features like social sharing, commenting, tagging and the like
  • online reservation and booking systems
  • classifieds solutions
  • event calendar and RSVP kind of systems
  • business directories
  • educational and government websites
  • portfolio systems

That’s just to name a few, as it’s very difficult to list each and every possibility. As they say, the limitation is your imagination—so true for Joomla!

Joomla! as a Web Framework

In day-to-day Joomla! development, there are times when you feel that you would have wanted to pull a certain part of the framework, the routing API for example, rather than a whole bunch of CMS features that are obsolete for that particular project. For a simple PHP-based application, it would be nice to have those selected features from the framework that are most suited to your application, rather than a whole CMS.

For example, say you want to build a service that exposes Joomla! data to a third-party mobile application. To achieve that, it's completely fine to make a custom extension that fulfills the desired functionality, but with the additional baggage of those unwanted CMS features in your case. Instead, what you would have loved to do is to select the APIs of your need by avoiding the rest of the features, and the end product is a super-light web application.

That's the purpose of Joomla! Framework, earlier known as Joomla! Platform. It allows you to build an application using a familiar set of APIs, if you're coming from the Joomla! CMS background. It provides a common set of APIs, as with the other PHP frameworks, allowing you to concentrate more on the application-specific features rather than reinventing the wheel for features like input handling, database abstraction layer, routing and the like.

It's by no means to be confused with the Joomla! CMS, as there's a separate line of development for both pieces of software. The main idea is to decouple the software packages into separate modules, rather than tying them into a single package, allowing them to evolve on their own. In fact, you could think of the Joomla! CMS as a combination of the Joomla! Framework and CMS modules.

One promising example of the Joomla! Framework is the Issue Tracker application of the Joomla! CMS itself. In the same way, you could build any web application with it that you would have built with any other PHP-based framework. Explore it and I'm sure there's something it has to offer for everyone.

Joomla!—a Quick Glance at the Major Elements

In this section, we'll discuss the important elements of the Joomla! architecture that serve as basic building blocks in any application.

Components

This is one of the most important and a must-have element in the stack that provides the complete functionality of any specific section. It allows you to create a base that deals with the business logic of an application. Also, it's one of the elements that extends Joomla!, should you like to introduce any new features.

For example, if you want to build a business directory application, one should be able to add, edit and delete the entries from the back-end. On the other hand, in the front-end it should display a nice listing along with advanced search, pager and sorting features. So it's the component you would like to build to wrap the aforementioned functionality.

As a rule of thumb, whenever you want to build any new functionality in Joomla!, it's the component that comes to the rescue.

Modules

Before I go ahead and explain what a module is in Joomla!, I would like to give you a couple of examples to make things easier. If you've ever visited Joomla! front-end, you'll see lots of blocks like Login, Latest Articles, Latest Feeds, etc. To your surprise, they are Joomla! modules assigned to different positions in the template! A Joomla! module is a movable block that builds the output by fetching the data from the component, most of the time, and displays the output.

Plugins

More often than not you’ll need to change the core framework behavior to fulfill your custom needs, and that’s where plugins come into the picture. A Joomla! plugin allows you to catch certain system-defined events, opening the door for customization of some of the important workflows.

As an example, say you would like to notify a third-party application in the event of new user registration on your website. Of course, there’s a provision to alter the data that transits back and forth between the event calls.

Templates

As the name suggests, it deals with the presentation layer of your website and helps structure your website layout. Sometimes, it’s also referred as a Joomla! theme as it allows you to change the look and feel of your website. To change the default look of the Joomla! core, you need to make a custom theme as per the Joomla! theme structure, and that’s something you’ll come across frequently if you’re a Joomla! developer.

Not to mention that the latest version of Joomla! comes with a responsive theme in the front-end and back-end. Also, it’s something expected from theme designers as well during the course of custom theme development.

What Is the Joomla! Extensions Directory (JED)?

The JED is something that you should make yourself familiar with, as you'll probably spend quite a bit of time there searching for an extension for your purpose. It's an official Joomla! site that offers plenty of extensions to choose from in the form of components, modules and plugins.

Extensions at JED are released under two kinds of license—free and commercial. As you may have guessed, the commercial extensions are paid goodies, available either on a subscription model or by paying a one-time fee. As a developer, it's an area you would like to get the benefit of, by developing quality extensions and releasing those under commercial license.

In fact, most of the time it works in this way: the free version of an extension is available with basic features, and the paid version of the same extension is boosted with power features, in the form of add-ons in some cases. Not to mention that the luxury of technical support from the extension service provider comes with the commercial version. Hence, it's a successful and proven business model for many commercial extension providers.

Having said that, I won't take any credit away from those quality free extensions that serve the purpose as well as any paid extension. In fact, it's a set of strict standards and rules each extension has to go through that makes sure that the extensions listed on JED meet the desired quality standards.

So, that's the JED at your disposal—make yourself comfortable with it and you'll be glad you did that.

Where Should I Start?

For first-time users, it’s always recommended to install Joomla! on your local system and explore the features in the front-end and back-end to get yourself used to the system. Here are some important resources for newbies:

For experienced PHP developers:

It’s such a wide subject that you’ll find plenty of online tutorials and videos at your disposal. Also, the members of Joomla! community forum are friendly enough to help you sort out any issues.

Conclusion

It was my pleasure to introduce one of the most popular open-source CMSs in the field of web development—Joomla! Although we’ve barely scratched the surface of the Joomla! world, I hope that I was able to do justice to the subject.

Starting with an introduction to CMSs, we’ve gone through the different aspects of Joomla!, followed by a discussion of important architectural elements. We also looked at the JED, and I provided some useful resources in the later part of this article.

Don’t hesitate to see what we have available for sale and for study in the marketplace, and don't hesitate to ask any queries and provide your valuable feedback using the feed below.


by Sajal Soni via Envato Tuts+ Code