An introduction to K2.

We have mentioned Joomla CCK's previously, and over the next few weeks we're going to introduce some of the principles of using the most popular one, K2.

Is it really as hard to learn as climbing the second highest mountain on Earth?

If you have no in depth web development background, then you may find some of the concepts of how K2 functions, or any other Content Construction Kit for that matter, tricky to understand. There are some simple features that may benefit you without too large an investment of time and effort, but that always depends on what you do with your site.

The more you know about planning a database for a dynamic website, the more K2's extra features might make sense and become useful to you right away. You won't need a Sherpa or extra oxygen to get through this extension, just maybe a bit of extra caffeine in your cup.

What is it and why do you need it?

As the provider's website states, K2 is a "powerful content component for Joomla!" But what does that mean? A Content Construction Kit can be used to add additional fields to items and greatly extend the default functionality of Joomla! articles, but K2 does a lot more than that too.

Nested Categories:

With 1.6, this isn't really an issue, but 1.5 will more than likely be around for a while. If you've gone out of your mind trying to work out the best way to structure your article categories WITHOUT being able to nest them, or place one category underneath another, your problems are solved here. More on why this is important coming soon!

Extra Fields:

If you've built a Joomla! website, you've almost certainly worked with image galleries, included some kind of video and stored some basic info about an article. As you most likely know, Joomla! utilizes certain fields to store information about each article, such as title, author name, author alias, and created date. If the articles on your site are anything more than basic informational copy with some images thrown in, you may have already found some difficulty with the limited number of fields you have to work with.

20110707_img01

K2 extends the basic capabilities of a Joomla! article and allows you to create your own "document types" by using additional fields, in essence creating the same functionality of a catalog, directory or other database type. This is especially useful if you are laying out some form of catalog but NOT using an e-commerce tool or shopping cart, such as Virtuemart. And the ability to include video clips and image galleries with each item is built in!

Have a quick look at the K2 demo site to see how the additional fields can be displayed in a catalog format.

You can also create custom layouts of your data with K2. Creating more than one type of layout based on the same "Item", as articles are called in K2, is relatively easy. Now you can set up your Item once, and then create a display for a page showing the full details of a record as well as a summary page showing only a few of the details. One record - multiple displays.

If a nested category structure and additional article fields are at all important to you, a CCK like K2 is essential.

What you need to begin using it.

K2 is currently only available for Joomla 1.5 sites; however, a new version is in development which will be compatible with 1.6 and 1.7.

Some understanding of the layout and functionality of databases is helpful when working with a dynamic web technology. Knowing what field types are and how you can use them in various situations can be quite helpful.

Most importantly, like all website projects – a good plan. Use your imagination, your psychic abilities or whatever future-seeing skills you have to plan what your site will look like a year out from when you start building. Ask yourself the important questions about what kind of information you will store and display BEFORE you begin building. This step will help you immeasurably, whether you use a CCK like K2 or stick with the default structure provided by the Joomla! framework.

We will introduce the next aspect of this powerful extension – K2 Categories – in two weeks. Next week we review the Pro version of Akeeba Backup.