Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • htomek Friend
    #156850

    Dear 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 Friend
    #364569

    Will anybody read my post? :confused:

    Saguaros Moderator
    #364603

    your 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”} –>

    htomek Friend
    #364729

    Oh man, what is brain 🙂
    tienhc you are the best!!!

    It’s working perfect and I’ll have to learn more of php because I’m bit shame wright now :p

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

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