-
AuthorPosts
-
htomek Friend
htomek
- Join date:
- February 2010
- Posts:
- 27
- Downloads:
- 0
- Uploads:
- 4
- Thanks:
- 7
- Thanked:
- 2 times in 1 posts
November 27, 2010 at 11:13 pm #156850Dear all,
Has here been any progress in question of making mod_jacatslwi to link on some other articles?
I need article pictures and texts to show in the frontpage but to link on some other articles.Wright now I’m changing modules/mod_jacatslwi/tmpl/default.php file to link on some other articles that I’ve made. I’ve made one more category that is new_category_ID = old_category_ID + 1 and new articles that are new_articles_IDs = old_articles_IDs + 3
So, I’m changing this line: $link = JRoute::_(ContentHelperRoute::getArticleRoute($l->slug, $l->catslug, $l->sectionid));
with this one:
$tmp = catslug + 1;
$tmp2 = slug + 3;
$link = JRoute::_(ContentHelperRoute::getArticleRoute($l->$tmp2, $l->$tmp, $l->sectionid));but I did not get what I want…
I thought that if I change the category and article IDs in $link, that it will work, but… :-[If anyone can help me in my problem, that would be great 🙂
htomek Friendhtomek
- Join date:
- February 2010
- Posts:
- 27
- Downloads:
- 0
- Uploads:
- 4
- Thanks:
- 7
- Thanked:
- 2 times in 1 posts
November 28, 2010 at 5:26 pm #364569Will anybody read my post? :confused:
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
November 29, 2010 at 2:43 am #364603your ways is wrong, it could not change the link of the article.
Now you try following to this:you open the file: /modules/mod_jacatslwi/tmpl/default.php and find the following code:
[PHP]
link = JRoute::_(ContentHelperRoute::getArticleRoute($l->slug, $l->catslug, $l->sectionid));
[/PHP]replace:
[PHP]
$link = JRoute::_(ContentHelperRoute::getArticleRoute($l->slug, $l->catslug, $l->sectionid));if( preg_match(“#{jalink(.*)}#s”, $l->text, $matches, PREG_OFFSET_CAPTURE) ){
if( isset($matches[0][0]) && preg_match(“#href=”(.*)”#s”, $matches[0][0], $m, PREG_OFFSET_CAPTURE) ){
$link = isset($m[1][0])? $m[1][0] : $link;
}
}
[/PHP]when done, you add a overriding link by adding this at top of article’s content
<!– {jalink href=”OVERRINGLINK HERE”} –>
-
AuthorPosts
This topic contains 4 replies, has 2 voices, and was last updated by htomek 13 years, 12 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum