- Posts: 4
COMMUNITY FORUM
Category image=Item image
- Selcuk Dogan
-
Topic Author
- Offline
- New Member
Less
More
12 years 5 months ago #107399
by Selcuk Dogan
Category image=Item image was created by Selcuk Dogan
Hi all,
I need your help. In K2 articles, I want article’s category picture to appear rather than article picture. While viewing article’s content, it doesn’t matter if the picture doesn’t appear. The important thing is that, article pictures need to be category picture in article list.
If you can’t do that, this would be fine for me: Can we give a direct picture way to article? What I’m trying to say is that, instead of uploading picture in article, I want to enter (insert) the picture way. For example: www.domain.com/images/image.jpg
Thank you for your help.
I need your help. In K2 articles, I want article’s category picture to appear rather than article picture. While viewing article’s content, it doesn’t matter if the picture doesn’t appear. The important thing is that, article pictures need to be category picture in article list.
If you can’t do that, this would be fine for me: Can we give a direct picture way to article? What I’m trying to say is that, instead of uploading picture in article, I want to enter (insert) the picture way. For example: www.domain.com/images/image.jpg
Thank you for your help.
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
12 years 5 months ago #107400
by william white
Replied by william white on topic Re: Category image=Item image
your link returns 404
Please Log in or Create an account to join the conversation.
- Peter Grube
-
- Offline
- Elite Member
Less
More
- Posts: 241
12 years 5 months ago #107401
by Peter Grube
Replied by Peter Grube on topic Re: Category image=Item image
Hi Selcuk,
If you are using template overides you can try this it works for me. ( it will show category image if no Item image is uploaded.)
In item.php find this code.
Line 206 I think
If you are using template overides you can try this it works for me. ( it will show category image if no Item image is uploaded.)
In item.php find this code.
Line 206 I think
php endif
Log in or Create an account to join the conversation.
- Selcuk Dogan
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 4
12 years 5 months ago - 12 years 5 months ago #107402
by Selcuk Dogan
Replied by Selcuk Dogan on topic Re: Category image=Item image
Hi Peter and thank you for answer.
I did the changes you advise and it worked. Thank for that.
But, I want this view to appear on item list, not item view.
PS: I think this change should be made in category_item.php and because of my template category_item.php is different, I copy the code below.
Edit: I Think I did. :)
I copied your second code category_item.php. Look.
and it worked. But the style changed. The image got to the top of the text. How do we take the text to the right side of the image? Now it looks like this:
I did the changes you advise and it worked. Thank for that.
But, I want this view to appear on item list, not item view.
PS: I think this change should be made in category_item.php and because of my template category_item.php is different, I copy the code below.
<?php if($this->item->params->get('catItemImage') && !empty($this->item->image)): ?>
<!-- Item Image -->
<div class="clr"></div>
<div class="catItemImageBlock" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;">
<span class="catItemImage">
<a href="<?php echo $this->item->link; ?>" title="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>">
<img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
</a>
</span>
<div class="clr"></div>
</div>
<?php endif; ?>
<div class="catItemHeader">
<?php if($this->item->params->get('catItemTitle')): ?>
<!-- Item title -->
Edit: I Think I did. :)
I copied your second code category_item.php. Look.
<!-- Item Image -->
<div class="clr"></div>
<div class="catItemImageBlock" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;">
<span class="catItemImage">
<a href="<?php echo $this->item->link; ?>" title="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>">
<img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
</a>
</span>
<div class="clr"></div>
</div>
<?php else: ?>
<div class="category_icon">
<img alt="<?php echo K2HelperUtilities::cleanHtml($this->item->category->name); ?>" src="media/k2/categories/<?php echo $this->item->category->image; ?>" style="width:<?php echo $this->params->get('catImageWidth'); ?>px; height:auto;" />
<div class="clr"></div>
</div>
<?php endif; ?>
and it worked. But the style changed. The image got to the top of the text. How do we take the text to the right side of the image? Now it looks like this:
Please Log in or Create an account to join the conversation.
- Peter Grube
-
- Offline
- Elite Member
Less
More
- Posts: 241
12 years 5 months ago #107403
by Peter Grube
Replied by Peter Grube on topic Re: Category image=Item image
Hi Selcuk
Sorry about misleading you, I should have read your question a bit closer, all I can suggest is try removing the first
Sorry about misleading you, I should have read your question a bit closer, all I can suggest is try removing the first
Log in or Create an account to join the conversation.
- Selcuk Dogan
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 4
12 years 5 months ago #107404
by Selcuk Dogan
Replied by Selcuk Dogan on topic Re: Category image=Item image
Finally, we did. :)
I change this section;
before
after
So that we kept the original style. Everything is perfect, I appreciate your help. Thank you very much...
I change this section;
before
<div class="category_icon">
after
<div class="catItemImageBlock" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;">
So that we kept the original style. Everything is perfect, I appreciate your help. Thank you very much...
Attachment not found
Please Log in or Create an account to join the conversation.