Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • dpchap015 Friend
    #183859

    I am trying to get a custom Link on JA Side News on my website
    Please see the image attached.
    I wish to redirect in the following way.

    10) No redirection
    11) Redirect to external link1.
    12) Redirect to external link2.

    I referred to a post here. http://www.joomlart.com/forums/topic/ja-side-news-custom-link/
    But dint get a reply. So had to start a new thread.

    Additionally, can i do something like this.
    Is this possible to edit the code as suggested by @luna Garden

    <h4 class="item-title">
    <a class="ja-title" href="<?php echo $item->link; ?>"><?php echo $helper->trimString( $item->title, $titleMaxChars );?></a>
    </h4>

    <?php if ($descMaxChars!=0) : ?>
    <p class="item-desc"><?php echo $helper->trimString( strip_tags($item->introtext), $descMaxChars); ?></p>
    <?php endif;?>

    <?php if( $showMoredetail ) : ?>
    <a class="readon" href="<?php echo $item->link; ?>"> <?php echo JTEXT::_("MORE_DETAIL"); ?></a>
    <?php endif;?>

    if i replace the code

    <?php echo $item->link; ?>

    with a if statement and make it look somewhat like this=>

    if(article_id=1)
    redirect=”#”
    else
    if(article_id=2)
    redirect=”external link1″
    else
    if(article_id=3)
    redirect=”external link2″
    else
    redirect=”<?php echo $item->link; ?>”

    will this resolve my issue.?

    Luna Garden Moderator
    #479598

    Hello,

    My suggestion will make all read more link point to the same external, not different pages.

    I’m afraid that, your request is out of support scope, you will need a developer to fix this extension as your way.

    But you can try by hide the readmore link, and in the article content, create the read more link to external link you want to.

    dpchap015 Friend
    #479875

    Ok. thanks for the reply, can u just tell me how does the JA joomla system call for an article, is it by the article ID or something else?
    If it’s by article ID, how do i call the the value of any article ID.
    like if i wish to save an article’s ID to a variable
    $aID = this->…. (what should be the call to store that value to the variable $aID)

    Luna Garden Moderator
    #480016

    Hi,

    In JA SideNews, and maybe some other modules, Article ID can be call like: <blockquote>$item->id</blockquote>

    But $item->id is an array, and you have to put them in a loop like
    foreach( $list as $item ){}

    dpchap015 Friend
    #480064

    @luna Thanks, i’ll try this out by creating a custom if else statement and will get back if i am stuck somewhere.

    dpchap015 Friend
    #480131

    hi @luna,
    i tried this,
    [PHP]<div class=”ja-slidenews-item”>

    <?php if( $showimage ): ?>
    <?php echo $helper->renderImage ($item, $params, $descMaxChars, $iwidth, $iheight ); ?>
    <?php endif; ?>

    <?php switch($item->id){
    case 80: ?>
    <a class=”ja-title” href=”http://link1″><?php echo $helper->trimString( $item->title, $titleMaxChars );?></a>
    <?php break;
    case 83: ?>
    <a class=”ja-title” href=”http://link2″><?php echo $helper->trimString( $item->title, $titleMaxChars );?></a>
    <?php break;
    default: ?>
    <a class=”ja-title” href=”<?php echo $item->link; ?>”><?php echo $helper->trimString( $item->title, $titleMaxChars );?></a>
    <?php }
    ?>

    <?php if (isset($item->date)) : ?>
    <span class=”ja-createdate”><?php echo JHTML::_(‘date’, $item->date, JText::_(‘DATE_FORMAT_LC4’)); ?> – </span>
    <?php endif; ?>[/PHP]

    as well as
    [PHP]<?php if($item->id == “80”): ?>
    <a class=”ja-title” href=”http://edtechreview.co”><?php echo $helper->trimString( $item->title, $titleMaxChars );?></a>
    <?php elseif($item->id == “83”): ?>
    <a class=”ja-title” href=”http://services.eduvative.in”><?php echo $helper->trimString( $item->title, $titleMaxChars );?></a>
    <?php else: ?>
    <a class=”ja-title” href=”<?php echo $item->link; ?>”><?php echo $helper->trimString( $item->title, $titleMaxChars );?></a>
    <?php endif; ?>[/PHP]

    But somehow the system is not performing the check. Its still doing the default redirection.

    Luna Garden Moderator
    #480315

    <em>@dpchap015 355656 wrote:</em><blockquote>hi
    i tried this,

    But somehow the system is not performing the check. Its still doing the default redirection.</blockquote>

    What file did you edit ?

    Please edit in this file:

    <blockquote>templatesja_merohtmlmod_jasidenewssidenews_image.php</blockquote>

    You will see there’s code like:

    <?php foreach( $list as $i => $item ) :
    $item->text = $item->introtext . $item->fulltext;
    $onclick = ' onclick="location.href=''.$item->link.''"';
    ?>

    Remove $item->link with your custom code for external link.

    dpchap015 Friend
    #480567

    <em>@Luna Garden 355874 wrote:</em><blockquote>What file did you edit ?

    Please edit in this file: templatesja_merohtmlmod_jasidenewssidenews_ima ge.php

    </blockquote>

    I was editing the <blockquote>templatesja_merohtmlmod_jasidenewsdefault.php</blockquote>

    I figured that it works by editing <blockquote> templatesja_merohtmlmod_jasidenewssidenews_content.php</blockquote>

    It dont work by editing templatesja_merohtmlmod_jasidenewssidenews_image.php, i guess because there is a overlay of the content as i bring my mouse on the image and the content part slides in and that is the only part clickable.

    Thanks for the help. @luna

    Luna Garden Moderator
    #480749

    Glad you did it and thanks for sharing the solution.

    acusticambiente Friend
    #494359

    <em>@dpchap015 356221 wrote:</em><blockquote>I was editing the

    I figured that it works by editing

    It dont work by editing templatesja_merohtmlmod_jasidenewssidenews_image.php, i guess because there is a overlay of the content as i bring my mouse on the image and the content part slides in and that is the only part clickable.

    Thanks for the help. @luna</blockquote>

    i have same problem. please, can you post the full code?

    dpchap015 Friend
    #494360

    <em>@acusticambiente 374814 wrote:</em><blockquote>i have same problem. please, can you post the full code?</blockquote>
    Here you go:
    [PHP]
    <div id=”ja-sidenews-<?php echo $moduleID; ?>”>

    <?php foreach( $list as $i => $item ) :
    $item->text = $item->introtext . $item->fulltext;

    /* Custom URL */
    if($item->id == “80”):
    $onclick = ‘ onclick=”window.open(‘http://your_custom_url’,’_blank’);”‘;
    else:
    $onclick = ‘ onclick=”location.href=”.$item->link.””‘;
    endif;

    ?>
    [/PHP]

    Hope this helps.

    acusticambiente Friend
    #494361

    it’s work! thanx 😉

    moghees Friend
    #510656

    This is an awesome tip!!! Very useful – thanks!!!

    kuschel Friend
    #512585

    Hello luna garden,

    i tried to make my own read-more link, but the side-news strip the code to text and so i have no link in the news. Is it possible not to strip the code in side-news?

    THank you very much for your help.

    Brigitte

    phong nam Friend
    #512764

    Hi Britgitte,

    I just want to repeat the Luna Garden’s suggestion is opening templatesja_merohtmlmod_jasidenewsdefault.php file, find lines:

    <?php if( $showMoredetail ) : ?>
    <a class="readon" href="<?php echo $item->link; ?>"> <?php echo JTEXT::_("MORE_DETAIL"); ?></a>
    <?php endif;?>

    Change the red text with your custom link.

    <blockquote>i tried to make my own read-more link, but the side-news strip the code to text and so i have no link in the news. Is it possible not to strip the code in side-news?</blockquote>

    I guese there is something wrong with the code you changed in default.php file, the code are stripped to the texts when you missed a tag ” ” or there is a php function is not put inside <?php ?>. Can you try to follow the tip above and come back to inform me the result.

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

This topic contains 15 replies, has 6 voices, and was last updated by  phong nam 10 years, 12 months ago.

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