Keyword

[SOLVED] Item image in category view - add url to image ?

  • jeanette hustad
  • jeanette hustad's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 9 months ago - 10 years 9 months ago #121796 by jeanette hustad
Replied by jeanette hustad on topic Re: Item image in category view - add url to image ?
Its a required text field (not area) with no default value.
And yes i see the whole url when looking at the article, it goes like this: www.bonderomantikk.no (showing http:// also in front of the www - it was just stripped here in this answer )

But i also notice when i hover the image, it is not showing me the address to www.bonderomantikk.no, its showing me www.skilsmisse.net

I figure there is something not quite right in the php code, but i cannot see where and whats might be wrong.

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 9 months ago #121797 by Yiota
Check that you have the Extrafields enabled in this category listing.

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

  • jeanette hustad
  • jeanette hustad's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 9 months ago #121798 by jeanette hustad
Replied by jeanette hustad on topic Re: Item image in category view - add url to image ?
That was it!
I had the fields displayed in item view but not in category view.

But, then there is another issue; what do i add to open the link in a new window (not self) ?

And also, would it be possible to somehow hide the extrafields in the category view, cause it dont look any good.....

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 9 months ago #121799 by Yiota
To open the link in a new page you have to add to the <a> property a target="_blank" as follows
<a href="<?php echo $this->item->extraFields->webadresse->value; ?>" title="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" target="_blank">

To hide the rest of the extra fields block you can either do it by commenting out its block of code in the category_item.php file or through css by adding to the class .catItemExtraFields a display:none;

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

  • jeanette hustad
  • jeanette hustad's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 9 months ago #121800 by jeanette hustad
Replied by jeanette hustad on topic Re: Item image in category view - add url to image ?
wow so pleased! :cheer:

Thank you so much Yiota and Krikor for amazing help! And thanks for beeing so patient with me :-)

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


Powered by Kunena Forum