Keyword

Default image in item view

  • Dave Logic
  • Dave Logic's Avatar Topic Author
  • Offline
  • New Member
More
13 years 10 months ago #90553 by Dave Logic
Default image in item view was created by Dave Logic
Hi,Is there a way to have a default image item placeholder,( much the same as a categories) in Item View ? I've searched the forum and cannot find anything.....I would imagine it would need some sort of modification to item.php ???Dave

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

  • Dave Logic
  • Dave Logic's Avatar Topic Author
  • Offline
  • New Member
More
13 years 10 months ago #90554 by Dave Logic
Replied by Dave Logic on topic Default image in item view
I currently have an override which modifies the K2 item page and moves the title , author to sit on top of the item image.

See live example here: www.aerosolplanet.com/United-Kingdom/Artist-Interviews/Inkfetish.html

The problem is that if an item image is not uploaded then the template looks terrible. Any ideas how I can have a default image if nothing is uploaded or maybe the first image in the article put here in the event of no image being uploaded...

Dave

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

  • Dave Logic
  • Dave Logic's Avatar Topic Author
  • Offline
  • New Member
More
13 years 10 months ago #90555 by Dave Logic
Replied by Dave Logic on topic Default image in item view
Any ideas... ?

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

More
13 years 10 months ago #90556 by william white
Replied by william white on topic Default image in item view
This wont be of much help but looking at the tables
jos_k2_category there is a field called image. If you upload a category image it gets named with the category id. Use phpmyadmin to check a category with an image.
From this post
community.getk2.org/forum/topics/how-change-k2-layout?commentId=3536014%3AComment%3A53695
I assume that the catalogue mode on or off will determine if a default placeholder image will show or not.
I expected to find code in category.php or category_item.php that tested for the existance of an image and if not then used the placeholder, but it must be deeper in the code. I have not found it
I think the addition of something like in your item.php may work
php if( isset ($ this-> category) && ( $ this->params-> get('catImage')
display the image
else
display the placeholder image
(syntax has been altered to display in post - for pseudocode only)

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

  • Dave Logic
  • Dave Logic's Avatar Topic Author
  • Offline
  • New Member
More
13 years 10 months ago #90557 by Dave Logic
Replied by Dave Logic on topic Default image in item view
Hi William,

Thanks...I'll take a look and see where I get...

David



William White said:This wont be of much help but looking at the tables jos_k2_category there is a field called image. If you upload a category image it gets named with the category id. Use phpmyadmin to check a category with an image.
From this post
community.getk2.org/forum/topics/how-change-k2-layout?commen...
I assume that the catalogue mode on or off will determine if a default placeholder image will show or not.
I expected to find code in category.php or category_item.php that tested for the existance of an image and if not then used the placeholder, but it must be deeper in the code. I have not found it
I think the addition of something like in your item.php may work
php if( isset ($ this-> category) && ( $ this->params-> get('catImage')
display the image
else
display the placeholder image
(syntax has been altered to display in post - for pseudocode only)

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


Powered by Kunena Forum