COMMUNITY FORUM
Image Caption as a linkable image
- Daily Deals UK
-
Topic Author
- Offline
- Junior Member
Less
More
8 years 6 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
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
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 6 months ago - 8 years 6 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?
Is there a link to this issue?
Last edit: 8 years 6 months ago by Krikor Boghossian.
Please Log in or Create an account to join the conversation.
- Daily Deals UK
-
Topic Author
- Offline
- Junior Member
8 years 6 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.
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
-
Topic Author
- Offline
- Junior Member
8 years 6 months ago - 8 years 6 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
<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: 8 years 6 months ago by Daily Deals UK.
Please Log in or Create an account to join the conversation.
- Daily Deals UK
-
Topic Author
- Offline
- Junior Member
8 years 6 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
-
Topic Author
- Offline
- Junior Member
8 years 6 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
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 6 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 :)
Please Log in or Create an account to join the conversation.
- Daily Deals UK
-
Topic Author
- Offline
- Junior Member
8 years 6 months ago - 8 years 6 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>
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: 8 years 6 months ago by Daily Deals UK.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 6 months ago #158580
by Krikor Boghossian
and
Will not return any data since nothing echoed. I do not think you need this code.
Replied by Krikor Boghossian on topic Image Caption as a linkable image
<?php $this->item->image_caption; ?>
<?php ($item->image_caption); ?>
Will not return any data since nothing echoed. I do not think you need this code.
Please Log in or Create an account to join the conversation.
- Daily Deals UK
-
Topic Author
- Offline
- Junior Member
8 years 6 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.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 6 months ago #158669
by Krikor Boghossian
Replied by Krikor Boghossian on topic Image Caption as a linkable image
There won't be an issue but you should remove these two lines.
Please Log in or Create an account to join the conversation.