- Posts: 10
COMMUNITY FORUM
if Related items has no images
- VADIMY
- Topic Author
- Offline
- New Member
Less
More
3 years 10 months ago #177706
by VADIMY
if Related items has no images was created by VADIMY
Attachments:
Please Log in or Create an account to join the conversation.
- VADIMY
- Topic Author
- Offline
- New Member
Less
More
- Posts: 10
3 years 10 months ago #177730
by VADIMY
Replied by VADIMY on topic if Related items has no images
Happy New Year!
How I can configure K2 if no images in articles?
I need to see only title if no image in article, please advice.
How I can configure K2 if no images in articles?
I need to see only title if no image in article, please advice.
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
3 years 10 months ago - 3 years 10 months ago #177764
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic if Related items has no images
Assuming you already have overrides for "item.php" you can check if the K2 image propery exists (in each K2 item object coming from the related items loop - if (isset($item->image)) { ... }) and then either display a placeholder image or just use a different HTML structure.
So edit this line github.com/getk2/k2/blob/master/components/com_k2/templates/default/item.php#L474 from:
to:
So edit this line github.com/getk2/k2/blob/master/components/com_k2/templates/default/item.php#L474 from:
<?php if($this->item->params->get('itemRelatedImageSize')): ?>
to:
<?php if($this->item->params->get('itemRelatedImageSize') && !empty($item->image)): ?>
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Last edit: 3 years 10 months ago by JoomlaWorks.
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
3 years 10 months ago #177776
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic if Related items has no images
Also fixed in K2: github.com/getk2/k2/commit/af51b22b11112db5e68e0d4657dada06e59ab9f4
This will be part of K2 v2.10.4.
This will be part of K2 v2.10.4.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
3 years 10 months ago #177777
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic if Related items has no images
Forgot to mention that the title you see as duplicate is actually the "alt" text from the <img> tag. With the new check, this won't be visible obviously.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- VADIMY
- Topic Author
- Offline
- New Member
Less
More
- Posts: 10
3 years 10 months ago #177810
by VADIMY
Replied by VADIMY on topic if Related items has no images
Thank you Fotis, but it definitely title+title.
No images in article.
This code (<?php if($this->item->params->get('itemRelatedImageSize') && !empty($item->image)): ?>) didn't help me.
No images in article.
This code (<?php if($this->item->params->get('itemRelatedImageSize') && !empty($item->image)): ?>) didn't help me.
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
3 years 10 months ago #177817
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic if Related items has no images
Any chance some K2 images exist and some got deleted? K2 will check if the "Generic" size exists to determine whether K2 images are there for some item to use.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.