Tuesday, 18 October 2011 00:00

Creating Tabbed Content in K2 Items

Written by 
Rate this item
(8 votes)

Sometime you may need to display data within your content using a tabbed layout form.

This can easily be done using a great, free download from No Number called Tabber.

Once you have downloaded, then install just like any other Joomla! extension. This plugin is enabled during installation.
Please make sure you bookmark their documents pages too, so that you have access to the syntax required, but it so easy using the following code.
Take a look at the plugin in the Plugins Manager as it does have some parameters you can play with. 

{ tab Tab Title 1 } Your text... { tab Tab Title 2 } Your text... { /tabs }

Using that code as an example, simply paste that into your K2 item. Please note, when you paste it, it may transfer some formatting from the site, so in your WYSIWYG editor, view the source and paste it their so that it strips any styling. Please also remove the blank space after "{" and before "}".

Let put that in to action.

Tab Title 1

Your text...

OK, so now you have some tabs in your item, lets push it a stage further and display K2 item content in those tabs.

Again, we are going to use a plugin from No Number, this time, Articles Anywhere.  Installation is as simple as before and again, there are some parameters that can be adjusted, but I have left the default settings in place.

This time, we drop in the Articles Anywhere syntax for K2 Items in place of the text we used before, which is as simple as { article k2:nnn } Please remove the blank space after "{" and before "}" and change nnn to the K2 Item ID number for the item you wish to display. 

K2 Item 1

Now the smart thing is, tab 1 has some additional syntax so that it shows the title,  100 characters of text and then a custom read more.
Full details can be found in the plugin parameters on in the No Number documents. 

{ tab K2 Item 1 } { article k2:nnn } { title } { text:50 } { readmore:Custom read more! }  { /article }

Thats it all done.

Play and enjoy.

Read 139411 times Last modified on Saturday, 29 March 2014 06:54