JoomlaBeacon

TJ AbrahamsenHello Joomla! friend. I am TJ. My goal with JoomlaBeacon is to be a Joomla! A-Z guide (beacon) for your own Joomla! based site. Please don't hesitate to comment, email, or suggest topics. More...

How to Show Introtext In Category List?

E-mail Print PDF
On my site I use the free JA_PURITY_II template from the awesome guys @ JoomlArt.com. This tutorial will mainly show what changes I did to my JA_PURITY_II template, but at the end I will show how it can be adapted to a standard installation of Joomla! 1.5.

BTW - My version does look a bit different than the default JA_PURITY_II template setup, since I am a hacker (lol).

I guess this would be a good time to introduce what this tutorial REALLY is about.. Smile.

What do we want to do?

In addition to being a very devoted Joomla! user and developer (or should we say "changer" or hacker...), I have about 12-13 years of experience with Oracle and Oracle PL/SQL. So, under the menu at the top you will find the menu item(s) "Library / PLSQL / String Functions". This is a sample of how it looks like without any introtext shown:

No Introtext In Category List Shown

Well, so...what's the problem...? You see...even if I have been an Oracle PL/SQL developer for so many years, I don't remember everything I have learned before... Let's say that you want to do something with a string in PL/SQL, but you can not rememeber what the name of that darn function was, and even if you see all the names of the string functions, you don't remember if it was this or that function. So, to make the life easier for the users of my web site, I made this nice little change:

This way the user can scroll through the list and see a quick intro of what the different funtions do without opening the article.

I have full control over where I want to use this functionality or not through my "String Functions" menu in my "mainmenu" setup on my Joomla! Administration pages.

On the "String Functions" parameter settings under "Parameters (Component) / Show Intro Text"  I can choose between "Show", "Use Global", or "Hide".

How do we do it?

To do this change we need to change one of the core Joomla! 1.5 files, BUT not directly. We use the ability in Joomla! 1.5 to do an "override". If you are not familiar with how to override files in Joomla! 1.5, please read this document:"Understanding Output Overrides".

Luckily, by using JA_PURITY_II, we get a lot for free, since many files are already put in override positions (through having been placed in the correct folders under the template) as a default.

The file we are looking for is named "default_items.php".You can find this file under the folder "/www/templates/ja_purity_ii/html/com_content/category". Inside this file we are looking for a place to add three lines, and that would be after line # 96:

<?php if ($this->params->get('show_intro')) : ?>
<br /><<?php echo $item->introtext; ?>
<?php endif; ?>

Well, that is it... That should be all we have to do to be "good to go".

This will work similar in the standard tempate as well. Override the file by putting it under the correct folder under your template. It looks like you have to add the three lines above after line # 76.

How this tutorial was good information for you.

~ TJ


TJ Abrahamsen
Written on Thursday, 04 February 2010 21:04 by TJ Abrahamsen

Viewed 495 times so far.
Like this? Tweet it to your followers!

Rate this article

(0 votes)

Latest articles from TJ Abrahamsen

Latest 'tweets' from TJ Abrahamsen

blog comments powered by Disqus

You are here: Guides Joomla Advanced How to Show Introtext In Category List?