Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Show Category Description on Category page?  (Read 6655 times)

0 Members and 1 Guest are viewing this topic.

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Show Category Description on Category page?
« on: December 29, 2013, 01:18:36 pm »

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Show Category Description on Category page?
« Reply #2 on: December 31, 2013, 12:26:28 am »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Show Category Description on Category page?
« Reply #3 on: December 31, 2013, 01:08:09 pm »

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

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Show Category Description on Category page?
« Reply #4 on: December 31, 2013, 01:29:36 pm »

Oh no worries. No hurry.

Thanks

Carl
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Show Category Description on Category page?
« Reply #5 on: January 02, 2014, 11:36:10 am »

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
Code: [Select]
global $template_cat_list, $lang_cat_list;and below, add something like
Code: [Select]
    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>";
        }
    }
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Show Category Description on Category page?
« Reply #6 on: January 03, 2014, 05:13:09 am »

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

Code: [Select]
// 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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Show Category Description on Category page?
« Reply #7 on: January 03, 2014, 09:22:40 am »

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

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Show Category Description on Category page?
« Reply #8 on: January 04, 2014, 01:31:58 am »

OK, sure, no problem. Thanks.
Logged
Pages: [1]   Go Up
 

Page created in 0.053 seconds with 21 queries.