How to hide K2 main image?

September 2015 Joomla Template
GK User
Tue Oct 18, 2016 8:36 pm
Hello!
I have K2 article with a main image, small intro txt and just another image in the full txt area (instead of any text after "read more"). Simple.
I'd like to show main k2 image thumbnail + intro txt in the NSP module on the frontpage, and when the visitor open that article, I don't want the main K2 image to be displayed. I don't want anything to be displayed in the item view except full txt.
When i go to item display properties, I disable everything in item view. I also disable main image in category view (just to be sure). Save and close. And item view shows main image. In category view main image is displayed too.
I want to apply that just on one specific K2 item, not on the whole category, not on the all articles that are in the NSP module on the frontpage.
Crime scene is here: http://adriaticnews.info/ru/component/k2/392-novibroj

What to do?
Thanks.
User avatar
Senior Boarder

teitbite
Thu Oct 20, 2016 9:43 am
Hi

Please add this code to override.css and make sure override is enabled in template settings.

Code: Select all
.item-content img, header img, #k2Container img {
    display: none;
}
User avatar
Moderator

GK User
Thu Oct 20, 2016 12:31 pm
Thank you, teitbite.
Before I try that:
My objective is to hide k2 main image for one specific article, not for all K2 articles. I'm not so good in coding to be creative, and correct me if I'm wrong: woudn't your method cause hiding of ALL k2 main article images?

Regards
User avatar
Senior Boarder

teitbite
Sun Oct 23, 2016 9:43 am
Hi

It would hide it on all. You may use a method described here: https://www.gavick.com/documentation/jo ... omla-pages but use this page class suffix combined with code I gave You instead, so You will hide image instead of content.
User avatar
Moderator

GK User
Tue Oct 25, 2016 12:21 am
I don't think we understand each other.
What I want, that shoud be simple as:
Open K2 article, on Display settings tab go to "item view options" and select "hide" for image.

Not working. K2 image still displayed in item view.


On the other hand, when testing your method:
Template Features tab > Suffixes for pages > ItemId 392 - Suffix nemaslike > Add rule
No sign of "nemaslike" in page source

Any idea? K2 template?
User avatar
Senior Boarder

teitbite
Thu Oct 27, 2016 4:56 pm
Hi

This template is different. Article look is based on an image being attached, so this option had to be disabled forcing to have it. This is why I'm trying to overwrite it with page class suffix. But I think You are using article ID instead of page ID. Page ID can be found in menu item list.

You can also disable our override for this article look by renaming /html/com_k2/templates/default/item.php to _item.php so original options which came with K2 will be usable.
User avatar
Moderator

GK User
Thu Oct 27, 2016 8:24 pm
teitbite,
I am working with Gavick templates from 2007, and I am allways satisfied with your help and answers. This time too. "This template is different" is enough for me, I'll try to do my task by using Newsletter popup. Or some other way. Thank you again.
User avatar
Senior Boarder

teitbite
Sat Oct 29, 2016 10:43 am
Hi

I probably can come up with overriding this but will need an access to FTP, to play with code to see what need to be done, but simplier would be, but only if You want to remove the image from all articles, add this to override.css

Code: Select all
.single-page.itemView > .header {
    display: none;
}
User avatar
Moderator


cron