Several pages for "news" section. (The locator-navigation for "news" section)

Hi.
I noticed that the “news” section do not have the navigation. I have a lot of news, they are contained on one page. It is inconvenient.
I want to use navigation: /index.php?cl=news, /index.php?cl=news&pgNr=1 and so on.
But how?
I understand that I need to change the file core/oxnewslist.php this function:

    public function loadNews( $iLimit = 0 )
    {
        if ( $iLimit ) {
            $this->setSqlLimit( 0, $iLimit );
        }

        $sNewsViewName = getViewName( 'oxnews' );
        $oBaseObject   = $this->getBaseObject();
        $sSelectFields = $oBaseObject->getSelectFields();

        if ( $oUser = $this->getUser() ) {
            // performance - only join if user is logged in
            $sSelect  = "select $sSelectFields from $sNewsViewName ";
            $sSelect .= "left join oxobject2group on oxobject2group.oxobjectid=$sNewsViewName.oxid where ";
            $sSelect .= "oxobject2group.oxgroupsid in ( select oxgroupsid from oxobject2group where oxobjectid='".$oUser->getId()."' ) or ";
            $sSelect .= "( oxobject2group.oxgroupsid is null ) ";
        } else {
            $sSelect  = "select $sSelectFields, oxobject2group.oxgroupsid from $sNewsViewName ";
            $sSelect .= "left join oxobject2group on oxobject2group.oxobjectid=$sNewsViewName.oxid where oxobject2group.oxgroupsid is null ";
        }

        $sSelect .= " and ".$oBaseObject->getSqlActiveSnippet();
        $sSelect .= " group by $sNewsViewName.oxid order by $sNewsViewName.oxdate desc ";

        $this->selectString( $sSelect );
    }

As well as I need to change the file views/news.php this function:

    public function getNews()
    {
        if ( $this->_oNewsList === null ) {
            $this->_oNewsList = false;
            $oActNews = oxNew( 'oxnewslist' );
            $oActNews->loadNews();

            if ( count($oActNews) ) {
                $this->_oNewsList = $oActNews;
            }
        }
        return $this->_oNewsList;
    }

Help me, please! :confused:

Hi,

this is about pagination, isn’t it? How many do you have and do you run into certain problems like memory_limit is not enough?
Sorry I can’t help you with this from the code side but maybe a Wordpress integration via TOXID could be interesting for you guys.
Also, I added this issue as a bug:
https://bugs.oxid-esales.com/view.php?id=3503

Regards

Hi, Marco!
Thanks! I decided to use a blog at Wordpress.