public function actionDetail()
 {
     $artikel = new ArtikelSearch();
     $detail = $artikel->getArtikelById($params = ['id' => $_GET['id']]);
     $detail = isset($detail['docs']) ? $detail['docs'] : $detail;
     // artikel terkait
     $per_page = \Yii::$app->params['pageSizeListview'];
     $per_page = isset($_GET['per-page']) ? $_GET['per-page'] : $per_page;
     $pagesize = isset($_GET['pagesize']) ? $_GET['pagesize'] : 0;
     // 5 = jumlah slider headeline
     $params = ['start' => $pagesize, 'limit' => $per_page, 'tagterkait' => $detail['tag'], 'idExcept' => $detail['id']];
     $artikelLainnya = $artikel->getArtikelLainnya($params = $params);
     //        if(empty($artikelLainnya['docs'])){
     //            $params = [
     //                'start' => $pagesize,
     //                'limit' => $per_page,
     //                'kat'    =>  $detail['categori_name'],
     //                'idExcept'    =>  $detail['id']
     //            ];
     //            $artikelLainnya = $artikel->searchArtikel($params = $params);
     //        }
     $dataProvider = new ArrayDataProvider(['key' => 'id', 'allModels' => isset($artikelLainnya['docs']) ? $artikelLainnya['docs'] : $artikelLainnya, 'pagination' => ['pageSize' => \Yii::$app->params['pageSizeListview']]]);
     // end artikel terkait
     // register SEO
     $detail = isset($detail[0]) ? $detail[0] : $detail;
     $count_summary = strlen($detail['summary']);
     $this->view->title = $detail['judul'];
     if ($count_summary > 155) {
         $description = strip_tags(substr($detail['summary'], 0, 152)) . '...';
     } else {
         $description = strip_tags($detail['summary']);
     }
     $penulis = ucwords($detail["author_name"]);
     $this->view->registerMetaTag(['name' => 'description', 'content' => $description], 'meta-description');
     $this->view->registerMetaTag(['name' => 'keywords', 'content' => $detail['tag']], 'meta-keywords');
     $this->view->registerLinkTag(['title' => $detail['judul']]);
     $this->view->registerMetaTag(['property' => 'fb:app_id', 'content' => '181411581975733'], 'property-fb:app_id');
     $this->view->registerMetaTag(['name' => 'author', 'content' => $penulis], 'meta-author');
     $this->view->registerMetaTag(['name' => 'publisher', 'content' => 'JurnalRumah.com'], 'meta-publisher');
     $this->view->registerMetaTag(['name' => 'content-language', 'content' => 'Indonesia'], 'meta-content-language');
     $this->view->registerMetaTag(['name' => 'distribution', 'content' => 'JurnalRumah : Jual Beli Rumah Baru dan Bekas'], 'meta-distribution');
     $this->view->registerMetaTag(['name' => 'robots', 'content' => 'index, follow'], 'meta-robots');
     $this->view->registerLinkTag(['rel' => 'canonical', 'href' => \Yii::$app->urlManager->createAbsoluteUrl(\Yii::$app->request->url)]);
     // register FB
     $this->view->registerMetaTag(['name' => 'og:title', 'content' => $detail['judul']]);
     $this->view->registerMetaTag(['name' => 'og:image', 'content' => Yii::$app->jurnalrumah->lihatImageDetail($detail['image1'], "", "artikel")]);
     $this->view->registerMetaTag(['name' => 'og:site_name', 'content' => 'JurnalRumah.com']);
     $this->view->registerMetaTag(['name' => 'og:url', 'content' => \Yii::$app->urlManager->createAbsoluteUrl(\Yii::$app->request->url)]);
     $this->view->registerMetaTag(['name' => 'og:description', 'content' => $description]);
     $this->view->registerMetaTag(['name' => 'og:type', 'content' => 'website']);
     return $this->render('detail', ['detail' => isset($detail[0]) ? $detail[0] : $detail, 'dataProvider' => $dataProvider]);
 }
Esempio n. 2
0
 public function actionIndex()
 {
     $per_page = \Yii::$app->params['pageSizeListview'];
     $per_page = isset($_GET['per-page']) ? $_GET['per-page'] : $per_page;
     $pagesize = isset($_GET['pagesize']) ? $_GET['pagesize'] + 5 : 5;
     // 5 = jumlah slider headeline
     $artikel = new ArtikelSearch();
     $artikelTerupdate = $artikel->getArtikelTerupdate();
     $params = ['start' => $pagesize, 'limit' => $per_page];
     $artikelLainnya = $artikel->getArtikelLainnya($params = $params);
     $dataProvider = new ArrayDataProvider(['key' => 'id', 'allModels' => isset($artikelLainnya['docs']) ? $artikelLainnya['docs'] : $artikelLainnya, 'pagination' => ['pageSize' => \Yii::$app->params['pageSizeListview']]]);
     $this->view->title = 'Jurnal Jual Beli Rumah Baru dan Bekas - JurnalRumah';
     $this->view->registerMetaTag(['name' => 'description', 'content' => 'Dapatkan informasi terkait rumah baru dan bekas'], 'meta-description');
     $this->view->registerMetaTag(['name' => 'keywords', 'content' => 'berita rumah, berita perumahan, tips rumah, tips perumahan, jurnalrumah, rumahbaru, rumahbekas, carirumah bekas, carirumahbaru, carirumahmurah, jualrumah bekas, jualrumah baru, jualrumahmurah, rumah tanpa riba'], 'meta-keywords');
     $this->view->registerMetaTag(['name' => 'author', 'content' => 'admin'], 'meta-author');
     $this->view->registerMetaTag(['property' => 'fb:app_id', 'content' => '181411581975733'], 'meta-property');
     $this->view->registerMetaTag(['name' => 'publisher', 'content' => 'JurnalRumah.com'], 'meta-publisher');
     $this->view->registerMetaTag(['name' => 'content-language', 'content' => 'Indonesia'], 'meta-content-language');
     $this->view->registerMetaTag(['name' => 'distribution', 'content' => 'JurnalRumah : Jurnal Rumah Baru dan Bekas'], 'meta-distribution');
     $this->view->registerMetaTag(['name' => 'robots', 'content' => 'index, follow'], 'meta-robots');
     $this->view->registerLinkTag(['title' => 'JurnalRumah Mobile Site', 'rel' => 'alternate', 'media' => 'handheld', 'href' => 'http://m.jurnalrumah.com']);
     $this->view->registerLinkTag(['title' => 'Canonical', 'rel' => 'canonical', 'href' => 'http://www.jurnalrumah.com']);
     $this->view->registerLinkTag(['title' => 'Publisher', 'rel' => 'publisher', 'href' => 'https://plus.google.com/115358618390268779655']);
     return $this->render('index', ['artikelTerupdate' => $artikelTerupdate, 'dataProvider' => $dataProvider]);
     //        return $this->render('index1');
 }
Esempio n. 3
0
 public function run()
 {
     $model = new ArtikelSearch();
     $artikelPopular = $model->getArtikelPopular();
     return $this->render('_wcontentright', ['artikelPopular' => $artikelPopular]);
 }