Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds

Managing Articles Using the K2 Content Construction Kit

Save for later
  • 480 min read
  • 2010-10-27 00:00:00

article-image

 


The reader would benefit from the previous article on Installation and Introduction of K2

Working with items AKA articles


The power of K2 is in the idea of categorizing your data, thus making it easier to manage. This will be especially helpful as your site grows in content. Many sites are fully article-based and it is not uncommon to see a site with thousands of articles on it.

In this section, we'll tackle some more category-specific recipes.

You may have noticed by now that data does not show up as typical articles do in Joomla!. In other words, if you added an item, set it published and featured, it may not be displayed on your site because you have not set up a menu item to your K2 content.

K2 will need to be added to your menu structure to display the items (articles) in K2.

The first recipe will take into account a site that has been in operation for a while and has K2 added to it.

Getting ready


This section assumes you have installed K2 and have content on your site.

How to do it...

  1. Make sure you have a full backup of the database and the files.
  2. Log in as the administrator.
  3. Open the K2 Dashboard.
  4. If you DID NOT import your content in, (see the first recipe), do so now.

    If you have ALREADY imported your content using the Import Joomla! Content button - DO NOT import again. You run the risk of duplicating all your content. Should this happen, you can go in and delete the duplicate items. This can be a time-consuming process.

  5. Open Article Manager | Content | Article Manager.
  6. Select all your articles from the Article Manager and unpublish.
  7. Open Menu Manager and find your Home menu.Now that we have unpublished content, we'll need to replace the traditional Joomla! content items with K2 content. Opening the Menu Manager and selecting the Home menu item will show this:

    managing-articles-using-k2-content-construction-kit-img-0


    As you can see under K2 there are several choices to display content on your site. I will choose Item | Item as my display mode. This will show my visitors content in article form.

    You can pick what works best for you. Now returning to the instructions:

  8. After choosing Menu Item Type - click Save.
  9. Open K2 Dashboard.
  10. Select Items.Here is a partial screenshot of the items in our sample site.

managing-articles-using-k2-content-construction-kit-img-1


As you can see, it now starts to take on a bit more traditional Joomla! look. I can choose featured articles, publish them, or note. Set the order they show up in, the category they belong to and more.

When you import content, from Joomla!, the articles retain their identity from Section and Category configuration. For example, the Joomla! Community Portal listed in the preceding screenshot as belonging to the category Latest has a parent category of News.

When you imported the content, sections became the new K2 top-level categories. All existing categories become subcategories of the new top level categories. As we added K2 to a working site with sections and category data already in place, I want to make sure they inherit from our master category.

In our sample site, we see the following screen when we open the K2 categories from the K2 Dashboard:

managing-articles-using-k2-content-construction-kit-img-2


We instruct the new top-level categories to follow the master category as the model for the rest. The following instructions will show you how.

  1. Open K2 Dashboard.
  2. Click Categories.
  3. Open your imported top-level categories - for this site it's About Joomla! and News. Each of these has sub-categories.
  4. Click About Joomla! (or your equivalent).
  5. Change the Inherit parameter options from category to MASTER CATEGORY USE AS INHERIT ONLY.
  6. Make sure the Parent category stays set to –None--.
  7. Click Save.When done, it will look like this:

    managing-articles-using-k2-content-construction-kit-img-3

Extra fields
Did you notice the Associated "Extra Fields Group" is set to - None - ? You can change this parent category group to use an extra fields group and still keep the master category parameters.


Each of the subcategories will inherit from the master category.

By doing this, you can still control all the categories parameters simply by changing the master category.

Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at ₹800/month. Cancel anytime

How it works...


The category system as described here for K2 is a giant access-control system allowing you the flexibility to structure your site and data as you need. It also offers a means to control the 'look and feel' of the articles from a central place.

When you import a Joomla! site into K2 you bring all the sections, content, articles, and other associated parts into it.

Sections become new parent categories and the old categories become subcategories. This can be a bit confusing at first. One suggestion is to write out on paper what you want the site to look like, and then lay out your categories. You might find that the structure you had can be more user-friendly using K2 and you will want to change.

This category system offers you nearly unlimited means to nest articles. In essence, a category can have unlimited categories under it. There is a limit to this in terms of management, but you get the idea.

There's more...


Using tags in K2 will give you the ability to improve your Search Engine Optimization or SEO on your site. Additionally, the use of tags will allow you to give your users the ability to follow the tags to other articles. In this section we'll review how to use Tags in K2.

Tags are keywords or terms that are assigned to your content. This enables your visitors to quickly locate what they need by one word descriptions.

Using Tags in K2


Tags can be created before an article is written or on the fly. I prefer on the fly as it will match the article. You can think of a tag almost as a dynamic index. Every time a tag is added to an article, it will show up in the K2 Tag Cloud module if you are using it. The more a single tag, such as Joomla!, is used in the content, the larger it appears in the K2 Cloud module.

K2 Tag Clouds can benefit your search engine optimization and a navigational element.

Here is an example of our K2 Tag Cloud:

managing-articles-using-k2-content-construction-kit-img-4


This is an image of our K2 Tag Cloud module. The more often a tag is added to an article, the larger it appears.

Setting up your site for Tag Clouds


K2 installs the K2 Tools module by default. The module has many functions, but for our purposes here, we'll use the Tag module.

  1. Log in to the Administrator Console of Joomla!.
  2. Click Extensions | Module Manager.
  3. Click New to create a new module.
  4. Find this for your new item:

    managing-articles-using-k2-content-construction-kit-img-5

  5. Once in there, give it a name and select its module location.
  6. On the right under Parameters, pull down the Select module functionality drop-down list as follows:

    managing-articles-using-k2-content-construction-kit-img-6

  7. Select Tag Cloud as shown in the preceding screenshot.
  8. Leave all the root categories set for none - this will enable K2 to pull in all the categories.
  9. Click Save.

This particular module, has many functions and you can set up a new module to use any of the great tools built into it.


Next you will want to add some tags to articles. As I said at the beginning of this article, you have two different ways to do this. You may add them to the article or you may add them to the Tag Manager. Let's quickly review the latter method.

  1. Open K2 Dashboard.
  2. Click Tags.
  3. You may see a list of tags there. If you wish to delete them, simply check the ones you want to remove and click Delete in the upper right-hand corner. Otherwise just leave them.
  4. Click New which will open the Details box. Fill in the tag; make sure it's published and click Save. This is an example of a filled out tag box (before save).

    managing-articles-using-k2-content-construction-kit-img-7

Adding Tags on the fly


This model allows you to tag the content as soon as you create it. If there are tags available, already such as those from the previous step, then you can add them.

  1. Open K2 Dashboard.
  2. Click Items.
  3. Select an item or click New to create an item.
  4. The field Tags will be blank, you can start to type in a field, such as K2 Content Creation Kit (as shown in the preceding screenshot). If it exists, then it will be available to be able to click and add.
  5. If there are no tags available, then simply type one in and click Return or add a comma.
  6. Here is an example item with tags.

    managing-articles-using-k2-content-construction-kit-img-8


    Here we have four tags, Security x, PHP x, Joomla x, K2 Content Creation Kit x. Any item (article) that has these tags will be easily found by both users and search bots. Let's see how our Tag Cloud looks now:

    managing-articles-using-k2-content-construction-kit-img-9


    You probably notice the changes, especially the addition of the new tag K2 Content Creation Kit. Clicking on that tag will yield two articles, and clicking on the Security tag yields three. Search engines can follow these links to better categorize your site. Users can get a sense of what is more important in terms of content from your site and it helps them navigate.

    Closing on this, I strongly suggest you spend time picking tags that are important on your site and is relevant to the purpose of it.