public function home()
    {
        $this->loadModel('Content.Contents');
        $contents = $this->Contents
            ->find('all')
            ->where([
                'Contents.promote' => 1,
                'Contents.status >' => 0,
                'Contents.language IN' => ['', null, I18n::locale()]
            ])
            ->order(['Contents.sticky' => 'DESC', 'Contents.created' => 'DESC'])
            ->limit((int)option('site_contents_home'));

        $this->set('contents', $contents);
        $this->viewMode('teaser');
    }
public function home()
    {
        $this->loadModel('Content.Contents');
        $contents = $this->Contents
            ->find('all')
            ->where([
                'Contents.promote' => 1,
                'Contents.status >' => 0,
                'Contents.language IN' => ['', null, I18n::locale()]
            ])
            ->order(['Contents.sticky' => 'DESC', 'Contents.created' => 'DESC'])
            ->limit((int)option('site_contents_home'));

        $this->set('contents', $contents);
        $this->viewMode('teaser');
    }
public function home ( ) { $ this -> loadModel ( 'Content.Contents' ) ; $ contents = $ this -> Contents -> find ( 'all' ) -> where ( [ 'Contents.promote' => 1 , 'Contents.status >' => 0 , 'Contents.language IN' => [ '' , null , I18n :: locale ( ) ] ] ) -> order ( [ 'Contents.sticky' => 'DESC' , 'Contents.created' => 'DESC' ] ) -> limit ( ( int ) option ( 'site_contents_home' ) ) ; $ this -> set ( 'contents' , $ contents ) ; $ this -> viewMode ( 'teaser' ) ; }
Site's home page.

Gets a list of all promoted contents, so themes may render them in their
front-page layout. The view-variable `contents` holds all promoted contents,
themes might render this contents using this variable.

@return void
Site s home page .