-
AuthorPosts
-
dpchap015 Friend
dpchap015
- Join date:
- September 2011
- Posts:
- 300
- Downloads:
- 75
- Uploads:
- 57
- Thanks:
- 1
- Thanked:
- 24 times in 1 posts
January 11, 2013 at 8:05 am #183859I 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 ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
January 14, 2013 at 9:00 am #479598Hello,
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 Frienddpchap015
- Join date:
- September 2011
- Posts:
- 300
- Downloads:
- 75
- Uploads:
- 57
- Thanks:
- 1
- Thanked:
- 24 times in 1 posts
January 15, 2013 at 3:50 pm #479875Ok. 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 ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
January 16, 2013 at 10:32 am #480016dpchap015 Frienddpchap015
- Join date:
- September 2011
- Posts:
- 300
- Downloads:
- 75
- Uploads:
- 57
- Thanks:
- 1
- Thanked:
- 24 times in 1 posts
dpchap015 Frienddpchap015
- Join date:
- September 2011
- Posts:
- 300
- Downloads:
- 75
- Uploads:
- 57
- Thanks:
- 1
- Thanked:
- 24 times in 1 posts
January 17, 2013 at 8:45 am #480131hi @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 ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
January 18, 2013 at 9:53 am #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 Frienddpchap015
- Join date:
- September 2011
- Posts:
- 300
- Downloads:
- 75
- Uploads:
- 57
- Thanks:
- 1
- Thanked:
- 24 times in 1 posts
January 21, 2013 at 7:35 am #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 ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
January 22, 2013 at 9:56 am #480749acusticambiente Friendacusticambiente
- Join date:
- December 2012
- Posts:
- 68
- Downloads:
- 14
- Uploads:
- 19
- Thanks:
- 9
May 30, 2013 at 9:46 am #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 Frienddpchap015
- Join date:
- September 2011
- Posts:
- 300
- Downloads:
- 75
- Uploads:
- 57
- Thanks:
- 1
- Thanked:
- 24 times in 1 posts
May 30, 2013 at 9:57 am #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.
1 user says Thank You to dpchap015 for this useful post
acusticambiente Friendacusticambiente
- Join date:
- December 2012
- Posts:
- 68
- Downloads:
- 14
- Uploads:
- 19
- Thanks:
- 9
May 30, 2013 at 10:54 am #494361it’s work! thanx 😉
October 30, 2013 at 9:55 am #510656This is an awesome tip!!! Very useful – thanks!!!
kuschel Friendkuschel
- Join date:
- February 2011
- Posts:
- 89
- Downloads:
- 52
- Uploads:
- 9
- Thanks:
- 2
- Thanked:
- 3 times in 1 posts
November 18, 2013 at 11:38 am #512585Hello 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 Friendphong nam
- Join date:
- May 2015
- Posts:
- 3779
- Downloads:
- 1
- Uploads:
- 587
- Thanks:
- 499
- Thanked:
- 974 times in 888 posts
November 19, 2013 at 7:29 pm #512764Hi 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.
-
AuthorPosts
This topic contains 15 replies, has 6 voices, and was last updated by phong nam 11 years, 1 month ago.
We moved to new unified forum. Please post all new support queries in our New Forum