test
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • noibihappy2009 Friend
    #137803

    In default janews layout is
    1|6
    2|7
    3|8
    4|9
    5|10

    But i want change to
    1|2
    3|4
    5|6
    …..
    Have anyways to do ?

    2. And beside that
    When i have no spec cat/sec entered in module params.
    I dont whats kind of sorting ???

    but i want it’ll sort by
    section.title AND cat.title AND article.title

    Thank you

    Anonymous Moderator
    #289811

    Hi noibihappy2009,

    Please go to this link http://www.joomlart.com/forums/topic/how-to-vary-layout-loop-in-blog-php-ja_news/ to solve your issue.

    noibihappy2009 Friend
    #290015

    <em>@JA Developer 110203 wrote:</em><blockquote>Hi noibihappy2009,

    Please go to this link http://www.joomlart.com/forums/topic/how-to-vary-layout-loop-in-blog-php-ja_news/ to solve your issue.</blockquote>

    Hi,
    But stil have one 1 more question still not solve.
    When i have no type spec cat in module param. I dun’t know how query ORDER use to query ???
    But i want it must be
    ORDER BY s.title, c.title
    and when it dislay must be group be s (dislay cat group by s)

    Example
    Sec A
    – Cat A1
    – Cat C2
    – Cat D3
    – Cat F4
    Sec B
    – Cat A
    – Cat A2
    – Cat C
    – Cat D1

    And when dislay will show

    – Cat A1
    – Cat C2
    – Cat D3
    – Cat F4
    // Because section A is first
    – Cat A
    – Cat A2
    – Cat C
    – Cat D1
    // Because section B is next

    In this moment look like your query will ORDER by cat, so
    – Cat A
    – Cat A1
    – Cat A2
    – Cat C
    – Cat C2
    …..

    Is it ok ?
    Thank you

    Anonymous Moderator
    #290388

    HI noibihappy2009,

    This order of section is according to the order of Category (Section) ID textbox.

    Anonymous Moderator
    #290389

    Open helper.php file in modulesmod_janews folder, at about line 285, find following code section:

    function getAllCatIds ($catorsec) {
    $db =& JFactory::getDBO();
    if($catorsec){
    $query = "SELECT id FROM #__categories WHERE published = 1;";
    }
    else{
    $query = "SELECT id FROM #__sections WHERE published = 1;";
    }
    $db->setQuery($query);
    $c = $db->loadObjectList();
    $catids = array();
    foreach($c as $_c) $catids[] = $_c->id;
    return $catids;
    }

    function getAllCatIdsBySection ($sectionid) {
    $db =& JFactory::getDBO();
    $query = "SELECT id FROM #__categories WHERE section = $sectionid;";

    $db->setQuery($query);
    $c = $db->loadObjectList();
    $catids = array();
    foreach($c as $_c) $catids[] = $_c->id;
    return $catids;
    }

    Here you can change the order of categories.

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

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

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