Keyword

[Parameters - Item display] Add "display category title" and "display category image"

  • Chuligan
  • Chuligan's Avatar Topic Author
  • Offline
  • New Member
More
13 years 4 months ago #96459 by Chuligan
Hi all,

it is possible to add an option in the category administration to display or hide the "category title" and the "category image" WITHIN the "paramenters - item display" section?

What I want is that when I visit an item of, for example, category A, I see, over the item title, the category title and the category image (as it's possible in the category page view).

I made an override in /templates templates/mytemplate/html/com_k2/templates/item.php

and added the following line:

<?php if($this->params->get('catImage') && $this->category->image): ?><!-- Category image -->            <img alt="<?php echo $this->category->name; ?>" src="<?php echo $this->category->image; ?>" style="width:<?php echo $this->params->get('catImageWidth'); ?>px; height:auto;" />            <?php endif; ?>            <?php if($this->params->get('catTitle')): ?>            <!-- Category title -->            <h2><?php echo $this->category->name; ?><?php if($this->params->get('catTitleItemCounter')) echo ' ('.$this->pagination->total.')'; ?></h2>            <?php endif; ?>


But nothing happens...

Any hint/suggestion?

Thank you in advance!

Please Log in or Create an account to join the conversation.

  • Chuligan
  • Chuligan's Avatar Topic Author
  • Offline
  • New Member
More
13 years 4 months ago #96460 by Chuligan
I've edited the strings above removing the "if", so it appears:

<!-- Category image -->            <img alt="<?php echo $this->category->name; ?>" src="<?php echo $this->category->image; ?>" style="width:<?php echo $this->params->get('catImageWidth'); ?>px; height:auto;" />

<!-- Category title -->            <h2><?php echo $this->category->name; ?><?php if($this->params->get('catTitleItemCounter')) echo ' ('.$this->pagination->total.')'; ?></h2>


But the category image and title won't appear in the item page...

Anyone?

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum