Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • jayatunge Friend
    #175272

    Currently, content slider articles are automatically linking to itself. Is there any way I can override these links? In other words, is it possible to direct all links in the contentslider to a separate one article I prefer?
    Any help would be really appreciated.

    And also, even if I disable the Title Link and Read more, still the image is linking to the article. How do I disable the image link?


    1. contentslider
    Sherlock Friend
    #445283

    Hi jayatunge,

    That’s strange, you can try as following steps
    1) Create a module parameter in the module back-end to put the link there, open the file of modulesmod_jacontentslidermod_jacontentslider.xml looking for this xml tag

    <field
    type=”text”
    name=”text_heading”
    default=””
    label=”TEXT_HEADING”
    description=”TEXT_HEADING_DESC” />

    Adding right below it this new tag

    <field
    type=”text”
    name=”alinks”
    default=””
    label=”Link For all articles”
    />

    2) you open the file of modulesmod_jacontentsliderhelper.php at about line 411 you would see this line of code
    [PHP] $data[$i]->link = modJacontentsliderHelper::articleLink($row);[/PHP]

    replace it by this block of code
    [PHP]
    if($params->get(‘alinks’,”) !== ”){
    $data[$i]->link = $params->get(‘alinks’);

    }else{
    $data[$i]->link = modJacontentsliderHelper::articleLink($row);
    }
    [/PHP]

    Also if you want to disable the links for images you can achieve it right on this file , looking for this line of code and just removing it
    [PHP] $image = ‘<a href=”‘ . $link . ‘” title=”” class=”ja-image”>’ . $image . ‘</a>’;[/PHP]

    I hope those changes make sense !

    jayatunge Friend
    #445578

    No one to help? Even JA staff or techie?
    Almost 05 days with out an answer………………..:((

    Please help.

    swissa Friend
    #445586

    <em>@jayatunge 309990 wrote:</em><blockquote>No one to help? Even JA staff or techie?
    </blockquote>

    Well, I’m neither! I can show you how to turn the link off on the image. Pay attention to my signature because it means hacking a file in joomlaroot/modules/mod_jacontentslider/helper.php

    If you take a back-up of the file then you’ll have a fall back.

    @ line 576 or thereabouts you need to edit out this line

    $image = '<a href="' . $link . '" title="" class="ja-image">' . $image . '</a>';
    so make it like this with the double //

    //$image = '<a href="' . $link . '" title="" class="ja-image">' . $image . '</a>';

    Much like a child who knows how to take things apart but not put them together that’s about all I can help you with! 😀

    Bestens

    *This works for my content slider v2.5.2

    swissa Friend
    #445592

    Actually, thinking it about and anyone is welcome to correct me if they think I may be wrong.

    You maybe could just use the link part to link to the article I think. Of course this will only work if this is the only instance of content slider you intend to use in the site without copying it completely and you would have to manually edit it if you want the link to change…..

    But if you feel adventurous and as you have a backup file, you could play to see if it works…

    $image = '<a href="your-link-goes-here"</a>';

    jayatunge Friend
    #445637

    Hi Swissa,
    You guided me in the right direction. You rock, Thank you.

    Commenting the whole line works, but it removes the bottom shadows from the images. So you have to leave the image class and remove the rest of the coding like this:
    $image = ‘<a class=”ja-image”>’ . $image . ‘</a>’;
    That really does the trick for me. Thank you!

    And I further went ahead and, tried your second posting by hard coding an url I want to direct the page to. Like this:
    $image = ‘<a href=”index.php/showcase/item-page” title=”Sample Item Page” class=”ja-image”>’ . $image . ‘</a>’;

    That really works! Once again thanks. :-*

    swissa Friend
    #445662

    Glad I was able to shine a light. Thanks for coming back and sharing the full solution – I’ll log this one for my own future reference!!

    Merci!

    jayatunge Friend
    #446320

    Hi Dat Hoang,
    I have tried your method too. I think that this is the safest method to achieve the objective of directing all to one external article. So, no need to hard code the link in to the helper.php
    Super! Big thank to you Hoang for the clear instructions. :-*

    kidi Friend
    #469332

    Hello,

    I’m not very well in english but understand how change the code (I hope).

    So in the modules/mod_jacontentslider/helper.php files I change the line :

    } else {
    $image = '';
    }

    $image = '<a href="index.php/showcase/item-page" title="Sample Item Page" class="ja-image">' . $image . '</a>';
    // clean up globals
    return $image;
    }

    But, sorry for my question, after, how add a different link to an external url for each image (or text) under each content on the content slider ?

    It’s certainly an easy question, but I doesn’t know the answer :-[

    Thank you for your help.

    Have a good evening.


    1. ExternalUrl
    Stork11 Friend
    #469412

    <em>@kidi 341356 wrote:</em><blockquote>Hello,

    I’m not very well in english but understand how change the code (I hope).

    So in the modules/mod_jacontentslider/helper.php files I change the line :

    } else {
    $image = '';
    }

    $image = '<a href="index.php/showcase/item-page" title="Sample Item Page" class="ja-image">' . $image . '</a>';
    // clean up globals
    return $image;
    }

    But, sorry for my question, after, how add a different link to an external url for each image (or text) under each content on the content slider ?

    It’s certainly an easy question, but I doesn’t know the answer :-[

    Thank you for your help.

    Have a good evening.

    </blockquote>
    Hello kidi,

    What do you mean as you mentioned “different link”? Would you like to append another anchor tag to image (or text)? Is it below code you wanna?
    $image = ‘<a href=”index.php/showcase/item-page” title=”Sample Item Page” class=”ja-image”>’ . $image . ‘</a>’ . ‘<a href=”another-link”>Another-Link</a>’;

    Regards.

    ditmedie Friend
    #470766

    What if I want a unique link to each image. I don’t just want every image to link to the same. Much like you are able to do in Ja Slideshow where you are able to define link on each image in slideshow..

    Any suggestions how to achieve this?

    Stork11 Friend
    #470836

    <em>@ditmedie 343241 wrote:</em><blockquote>What if I want a unique link to each image. I don’t just want every image to link to the same. Much like you are able to do in Ja Slideshow where you are able to define link on each image in slideshow..

    Any suggestions how to achieve this?</blockquote>
    Hello ditmedie,

    JA ContentSlider only gets links from articles. You can’t define links by manually.

    Regards.

    HeR0 Friend
    #470837

    Hi Ditmedie
    You should get a good developer from http://joomlancers.com to do this feature.

    Regards,

    ditmedie Friend
    #471083

    Okay, thanks.. Would be a nice feature to have in the future:)

Viewing 14 posts - 1 through 14 (of 14 total)

This topic contains 14 replies, has 7 voices, and was last updated by  ditmedie 12 years ago.

We moved to new unified forum. Please post all new support queries in our New Forum