test
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • Paul Wallen Friend
    #145674

    Am I dumb or is there not a way to display only certain categories in janews 2?

    Is this limited by only sections…and categories within that section???

    If so, I am going to be forced to use some other setup for displaying news because this will simply not work.

    Anonymous Moderator
    #322506

    Hi paulwallen

    I would like to answer your questions as follows:

    1. Am I dumb or is there not a way to display only certain categories in janews 2?

    => It is possible. Please open modules/ja_janews/helper.php file, 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;

    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 ”

    At that time, you can control to display three categories as the ordering field.

    2. Is this limited by only sections…and categories within that section???
    Current, this module only supports you to use sections.

    tranaee Friend
    #324623

    Sorry I’m replacing the code as you said and I get a:
    Parse error: syntax error, unexpected T_VARIABLE in /home/above/public_html/telegramm/modules/mod_janews2/helper.php on line 837

    Anonymous Moderator
    #324865

    Please change
    $query .= " order by s.ordering "
    to

    $query .= " order by s.ordering ";

    tranaee Friend
    #324978

    Thank you again JOOMLART!! I think using that ordering tip JA-News2 got a lot more flexible making it a super perfect tool for the pros!! I think you should add tha feature in your next updtate!!

    padunic Friend
    #325076

    <em>@tranaee 154635 wrote:</em><blockquote>Thank you again JOOMLART!! I think using that ordering tip JA-News2 got a lot more flexible making it a super perfect tool for the pros!! I think you should add tha feature in your next updtate!!</blockquote>
    I have tried this….crash all my site. Not work. 😮

    tranaee Friend
    #325077

    <em>@padunic 154766 wrote:</em><blockquote>I have tried this….crash all my site. Not work. :o</blockquote>

    No, no, no.. It used to crash my site as well but there was an error in the first post from joomlart!
    YOU MUST ADD A “;” AFTER $query .= ” order by s.ordering “

    So summing it all together:

    Open modules/ja_janews/helper.php file, 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;

    and replace with
    :
    $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 “;

    Please try it!
    Now you have a front page displaying all the categories that you wish by just adjusting the category order!! GREAT!!

    padunic Friend
    #325172

    <em>@tranaee 154768 wrote:</em><blockquote>No, no, no.. It used to crash my site as well but there was an error in the first post from joomlart!
    YOU MUST ADD A “;” AFTER $query .= ” order by s.ordering “

    So summing it all together:

    Open modules/ja_janews/helper.php file, 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;

    and replace with
    :
    $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 “;

    Please try it!
    Now you have a front page displaying all the categories that you wish by just adjusting the category order!! GREAT!!</blockquote>
    Hi, i made like you suggest and not crash in this time, but nothing change in backend. Its correct?

    Regards

    Padunic

    cre8 Friend
    #325179

    Is it possible to only show certain sections and not every section available?

    tranaee Friend
    #325180

    <em>@padunic 154901 wrote:</em><blockquote>Hi, i made like you suggest and not crash in this time, but nothing change in backend. Its correct?

    Regards

    Padunic</blockquote>

    Yes it is! But, you can order from now on, the category order in the back end and that affects the order in the front page as well!! 😉
    C’mon give it a try and be happy my friend!!:)

    tranaee Friend
    #325181

    <em>@cre8 154909 wrote:</em><blockquote>Is it possible to only show certain sections and not every section available?</blockquote>

    Ofcourse!
    In the backend go in the janews2 module and in the big square mid-right you can list only the section ids you’d like.
    To find the section id go to section manager highlight the sction you want and check the id number far-right! 😉

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

This topic contains 11 replies, has 5 voices, and was last updated by  tranaee 15 years ago.

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