Keyword

Image Caption as a linkable image

  • Daily Deals UK
  • Daily Deals UK's Avatar Topic Author
  • Offline
  • Junior Member
More
7 years 11 months ago #158447 by Daily Deals UK
Image Caption as a linkable image was created by Daily Deals UK
Hi

Can someone tell me if this is doable....

I want to be able to submit a URL in the captions text box and it to show as a clickable button instead of the usual text under the picture.

I tried adding background-image: url("images/visit-website.png"); to span.itemImageCaption to test if image would show and it didn't

Thanks
Claire

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 11 months ago - 7 years 11 months ago #158486 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image Caption as a linkable image
Hello,

Is there a link to this issue?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Last edit: 7 years 11 months ago by Krikor Boghossian.

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

  • Daily Deals UK
  • Daily Deals UK's Avatar Topic Author
  • Offline
  • Junior Member
More
7 years 11 months ago #158510 by Daily Deals UK
Replied by Daily Deals UK on topic Image Caption as a linkable image
Hi Krikor

The link to my website is dailydealsblog.co.uk

What I'm trying (and failing) to achieve is the images caption to be an image/button and instead of adding text in the K2 backend, I'd add a link and then on the front end it would show as a clickable button.

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

  • Daily Deals UK
  • Daily Deals UK's Avatar Topic Author
  • Offline
  • Junior Member
More
7 years 11 months ago - 7 years 11 months ago #158525 by Daily Deals UK
Replied by Daily Deals UK on topic Image Caption as a linkable image
Ok I'm half way there (unbelievably)

<span class="itemImageButton"><?php ($item->image_caption); ?>
<a href="<?php echo $item->image_caption; ?>" title="Visit Website" target="_blank">
<img src="images/visit-website.png" alt="Get Deal" />
</a>
</span>

Works perfectly in category_item.php and tag.php

In item.php this is almost it:
<span class="itemImageCaption"><?php echo $this->item->image_caption; ?>
<a href="<?php echo $this ->item->image_caption; ?>" title="Visit Website" target="_blank">
<img src="images/visit-website.png" alt="Get Deal" />
</a>
</span>

Except the text entered is showing as well as the linkable button
Last edit: 7 years 11 months ago by Daily Deals UK.

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

  • Daily Deals UK
  • Daily Deals UK's Avatar Topic Author
  • Offline
  • Junior Member
More
7 years 11 months ago #158531 by Daily Deals UK
Replied by Daily Deals UK on topic Image Caption as a linkable image
Got it thanks :)

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

  • Daily Deals UK
  • Daily Deals UK's Avatar Topic Author
  • Offline
  • Junior Member
More
7 years 11 months ago #158532 by Daily Deals UK
Replied by Daily Deals UK on topic Image Caption as a linkable image
Got it thanks :)

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 11 months ago #158546 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image Caption as a linkable image
Nice to know that you got it working. Kudos :)

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Daily Deals UK
  • Daily Deals UK's Avatar Topic Author
  • Offline
  • Junior Member
More
7 years 11 months ago - 7 years 11 months ago #158561 by Daily Deals UK
Replied by Daily Deals UK on topic Image Caption as a linkable image
Here's the code in case anyone ever needs it.

In tag.php

<span class="itemImageButton"><?php ($item->image_caption); ?>
<a href="<?php echo $item->image_caption; ?>" title="Visit Website" target="_blank">
<img src="images/visit-website.png" alt="Get Deal" />
</a>
</span>

(Obviously use your own class)

In item.php and Category_item.php

<span class="itemImageCaption"><?php $this->item->image_caption; ?>
<a href="<?php echo $this ->item->image_caption; ?>" title="Visit Website" target="_blank">
<img src="images/visit-website.png" alt="Get Deal" />
</a>
</span>
Last edit: 7 years 11 months ago by Daily Deals UK.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 11 months ago #158580 by Krikor Boghossian
Replied by Krikor Boghossian on topic Image Caption as a linkable image
<?php $this->item->image_caption; ?>
and
<?php ($item->image_caption); ?>

Will not return any data since nothing echoed. I do not think you need this code.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Daily Deals UK
  • Daily Deals UK's Avatar Topic Author
  • Offline
  • Junior Member
More
7 years 11 months ago #158663 by Daily Deals UK
Replied by Daily Deals UK on topic Image Caption as a linkable image
It's all working ok?

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


Powered by Kunena Forum