Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
You are here: HomeForum
Welcome, Guest

[SOLVED] Change link on slider image
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: [SOLVED] Change link on slider image

[SOLVED] Change link on slider image 8 years, 7 months ago #15271

Hi there,

Is there any way I can change the link on the articles slider images to go to the URL set in "Link A" in the article rather than link directly to the article itself?

Is there some code in the default.php that I could change to get this functionlity to work? If so, could you please let me know what to change / add?

Your help with this is very much appreciated.

Also I think this would be a great feature for this slider to have as a built in option as it expands how it can be used e.g. it could be used to have adverisements on websites that link to external websites not just showcasing articles on the website.

Thanks again for your assistance.

Gem

Re: Change link on slider image 8 years, 7 months ago #15312

I worked it out

For anyone else who might want to modify this functionality what I did was create a template override for the module then in the detault.php file search for

<a href="<?php echo $item->link;?>" <?php echo ArticlesSliderHelper::parseTarget($options->item_link_target);?>>
<?php $img = ArticlesSliderHelper::getAImage($item, $params);
echo ArticlesSliderHelper::imageTag($img);?>
</a>

and change to:

<a href="<?php $urls = json_decode($item->urls);
echo $urls->urla;?>"
<?php echo ArticlesSliderHelper::parseTarget($options->item_link_target);?>>
<?php $img = ArticlesSliderHelper::getAImage($item, $params);
echo ArticlesSliderHelper::imageTag($img);?>

</a>


I hope this helps someone else
The following user(s) said Thank You: 1uptech, anhqn
  • Page:
  • 1
Time to create page: 0.49 seconds

Notification

Please find your issue via Suggested Posts before submitting your question. We have solved the most of issues and maybe your issue was solved before.

Suggested Posts

(/)
Result not found!

Latest My Topics

No posts to display.

Love all our templates?

Join our membership clubs starting at $49 only for access to all of our templates

Join Now
Home Pricing
Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
SearchSupport
Magento Themes Magento Extensions Free Magento Extensions Prestashop Themes Prestashop Modules Magento 2 Themes