Show Category Description on Category page? Show Category Description on Category page?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Show Category Description on Category page?

Started by Walkinman, December 29, 2013, 01:18:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Walkinman

Hey Folks,

Sorry to be bombarding everyone, it's that time of year when I try to get my website updates done. This should be a relatively simple question; I searched for it but didn't find what I was looking for.

I would like to have the description for the Category, from category properties, show on the thumbnail display for that category

See here

http://www.skolaiimages.com

example.com/stock/index-27.html

replace example with http://www.skolaiimages.com

Rather than just show the breadcrumb, I would like the page to show, under the breadcrumb, and then in the box where the thumbnails display a h1 tag saying the name of the category, and then text showing the description of the category. if you back up one category in the above example to 'wildlife photos', you'll see each sub category has it's description there .. I would like the sub category to do the same, show the Name and description for that that category, then the various thumbnails and album titles under that.

As is, for example, in the Category 'Wildlife Photos', I don't have the description for that category, but I do have for the sub categories. That doesn't help a page optimized for 'wildlife photos' if all that phrase isn't in the content. Make sense?

Where it gets harder, i guess, is ideal on sub categories, I would NOT want the parent category and description to show .. just the name of the actual category page you're on, and it's description.

Sorry to be so long-winded about it. it's late here.

Thanks again

Cheers

Carl


Walkinman

Hey André

Thanks - Looked over that thread before, as well; it talks about Album pages, but not Category Pages. I have things working fine on the albums, but the Categories don't. What I want is for the description of the Category to show up, just beneath the name of the Category (as in the OP asked in the link you posted, but for Cat, not alb) on the page for the Category?

For example

www.skolaiimages.com

/stock/index-27.html

is a Category for bears .. I would like to add the Category Name, then a Description, above the thumbnails, under the breadcrumb .. so basically, like the request in the OP you linked to, but for categories, not albums?

Thanks.

Αndré

Oops sorry I misread your question. Will post a solution as soon as possible (which is probably not today).

Walkinman


Αndré

Copy the function theme_display_cat_list from themes/sample/theme.php to your theme's theme.php file, if it doesn't exist. Then, find
global $template_cat_list, $lang_cat_list;
and below, add something like
    global $CONFIG;
    $superCage = Inspekt::makeSuperCage();
    if ($superCage->get->keyExists('cat') && $superCage->get->getInt('cat') > 0) {
        $cat = mysql_fetch_assoc(cpg_db_query("SELECT name, description FROM {$CONFIG['TABLE_CATEGORIES']} WHERE cid = ".$superCage->get->getInt('cat')." LIMIT 1"));
        echo "<h1>{$cat['name']}</h1>";
        if ($cat['description']) {
            echo "<p>{$cat['description']}</p>";
        }
    }

Walkinman

Perfect, thanks so much André. I know this is a different question, but it seems relevant enough to post here as well. If you'd rather me start a new threat I can do that.

How do I make the meta tag description tag show up (not on the page in the header)? I thought I had it showing up before, but I don't see it now for Category pages. I tried adding this code, which is what generates the meta tag for albums


// trying to add a meta tag description

$meta_description = $CURRENT_ALBUM_DATA['meta_description'] ? $CURRENT_ALBUM_DATA['meta_description'] : $CURRENT_ALBUM_DATA['description'];
if ($meta_description)
{
    $meta_keywords .= '<meta name="description" content="' . htmlspecialchars($meta_description) . '" />' . $LINEBREAK;
}


and also changing $CURRENT_ALBUM_DATA to $CURRENT_CAT_DATA but that didn't work either. That above is the code I have to produce the meta tag for album thumbnails, and I thought maybe I could slide it into the display_cat_list section, but it doesn't work.

Thanks so much

Cheers

Carl

Αndré

Please start a new thread for your second issue, as it's not related IMHO.

Walkinman