test
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • Greg Banig Friend
    #148391

    I am using JA News 2 in the JA Teline III template.

    How can I control the display order of the categories? I have a Section with three Categories.

    1) Category 1 = “Southern”
    2) Category 2 = “Central”
    3) Category 3 = “Northern”

    I would like them to display in JA News 2 in this order.

    However, the Categories are displayed Northern, Southern, Central.

    Anonymous Moderator
    #331500

    Hi gregbanig

    For the case, i think you should order these categories via ordering field and then open modules/ja_news2/helper.php file, at about line 413, find following code:


    $query = "SELECT `id`, `title`, `description`, CASE WHEN CHAR_LENGTH(`alias`) THEN CONCAT_WS(":", `id`, `alias`) ELSE `id` END as `slug` FROM `#__categories` s WHERE published = 1 and section=" . ( int ) $sid . $where;
    $db->setQuery ( $query, 0, $limit );

    and change to:


    $query = "SELECT `id`, `title`, `description`, CASE WHEN CHAR_LENGTH(`alias`) THEN CONCAT_WS(":", `id`, `alias`) ELSE `id` END as `slug` FROM `#__categories` s WHERE published = 1 and section=" . ( int ) $sid . $where;

    $query .= " ORDER BY s.ordering ASC"; //$query .= " ORDER BY s.id ASC";
    $db->setQuery ( $query, 0, $limit );

    etnasci Friend
    #331502

    <em>@JA Developer 152249 wrote:</em><blockquote>Hi gregbanig

    For the case, i think you should order these categories via ordering field and then open modules/ja_news2/helper.php file, at about line 413, find following code:


    $query = "SELECT `id`, `title`, `description`, CASE WHEN CHAR_LENGTH(`alias`) THEN CONCAT_WS(":", `id`, `alias`) ELSE `id` END as `slug` FROM `#__categories` s WHERE published = 1 and section=" . ( int ) $sid . $where;
    $db->setQuery ( $query, 0, $limit );

    and change to:


    $query = "SELECT `id`, `title`, `description`, CASE WHEN CHAR_LENGTH(`alias`) THEN CONCAT_WS(":", `id`, `alias`) ELSE `id` END as `slug` FROM `#__categories` s WHERE published = 1 and section=" . ( int ) $sid . $where;

    $query .= " ORDER BY s.ordering ASC"; //$query .= " ORDER BY s.id ASC";
    $db->setQuery ( $query, 0, $limit );

    </blockquote>

    Ok! This code is ok!

    Greg Banig Friend
    #331503

    Thanks. That solved what I was looking for. The code that needed replaced was actually line #553 and…

    $query = “SELECT `id`, `title`, `description`, CASE WHEN CHAR_LENGTH(`alias`) THEN CONCAT_WS(“:”, `id`, `alias`) ELSE `id` END as `slug` FROM `#__categories` s WHERE published = 1 and section=”.(int)$sid.$where;

    purina Friend
    #331506

    <em>@gregbanig 163437 wrote:</em><blockquote>Thanks. That solved what I was looking for. The code that needed replaced was actually line #553 and…

    $query = “SELECT `id`, `title`, `description`, CASE WHEN CHAR_LENGTH(`alias`) THEN CONCAT_WS(“:”, `id`, `alias`) ELSE `id` END as `slug` FROM `#__categories` s WHERE published = 1 and section=”.(int)$sid.$where;</blockquote>
    OK but what about if I want to show some of the categories from more then three

    madeline63 Friend
    #338272

    HI,

    I am trying to show my section by using ja news2, but not only at frontpage

    i am using JA teline III.

    thanks

    Saguaros Moderator
    #338384
    madeline63 Friend
    #338424

    hi, J.O.O.M staff

    thanks for your quick reply,

    do your have any suggestion for this? any module can make this?

    Saguaros Moderator
    #338874

    Dear madeline63!

    I am sorry for not being of much help in this case. i do not know the module you need in where 🙁

    fmedia Friend
    #340108

    hi,

    this will help re-order the categories inside sections on janews2. but how do we re-order the sections?

    thank you

    Saguaros Moderator
    #340173

    Dear fmedia!

    Please access the configuration of the ja news 2 module, you re-order Section IDs in the “Section Ids” Parameter

    Example:

    Original:

    13:red
    14:orange
    8:deepblue
    12:cyan
    5:green
    9:pink
    11:lime
    6

    change order of sections:

    5:green
    9:pink
    13:red
    14:orange
    8:deepblue
    11:lime
    6
    12:cyan

    Good luck

    guap Friend
    #351891

    <em>@gregbanig 163433 wrote:</em><blockquote>I am using JA News 2 in the JA Teline III template.

    How can I control the display order of the categories? I have a Section with three Categories.

    1) Category 1 = “Southern”
    2) Category 2 = “Central”
    3) Category 3 = “Northern”

    I would like them to display in JA News 2 in this order.

    However, the Categories are displayed Northern, Southern, Central.</blockquote>

    I go the category manager and use the “arrow” to arrange in order. It works for me.

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

This topic contains 12 replies, has 8 voices, and was last updated by  guap 14 years, 4 months ago.

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