person.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?
  2. use app\modules\ldjson\jsonLD;
  3. use yii\helpers\Url;
  4. $this->title = $model->name;
  5. $this->params['breadcrumbs'] = [
  6. ];
  7. $this->params['breadcrumbs'][] =
  8. [
  9. "text"=>$model->name,
  10. "url"=>"/person/".mb_strtolower($model->alias)
  11. ];
  12. Yii::$app->og->title = $model->name;
  13. Yii::$app->og->description = $model->name.': '.$model->jobtitle;
  14. Yii::$app->og->canonical = $model->getUrl(true);
  15. Yii::$app->og->og_url = $model->getUrl(true);
  16. Yii::$app->og->og_image = $model->getImg('1','jpg');
  17. Yii::$app->og->og_type = "person";
  18. Yii::$app->og->og_title = htmlspecialchars($model->name);
  19. Yii::$app->og->og_description = htmlspecialchars(Yii::$app->og->description);
  20. //Yii::$app->og->dtpub = date( "r", strtotime( '10.04.2023 12:40:00' ) );
  21. jsonLD::addAmicORG();
  22. //jsonLD::news( $model->title, preg_replace('/\s+/', ' ', str_replace( ["\n","\r"],' ',Yii::$app->og->description)), $model->image->url, $model->dt_pub, $model->getUrl(), $model->uid, $model->text);
  23. jsonLD::person( $model->name, $model->description, $model->jobtitle, Url::base('https').$model->getImg('1','jpg', true), $model->getUrl(true), $model->birthdate);
  24. $i = 1;
  25. foreach($this->params['breadcrumbs'] as $el){
  26. jsonLD::addBreadcrumb($i, $el['url'], $el['text']);
  27. $i++;
  28. }
  29. ?>
  30. <div class="row justify-content-md-center">
  31. <div class="col-md-10">
  32. <?=$this->render("/layouts/breadcrumbs")?>
  33. <div id="post" class="post">
  34. <section class="text person">
  35. <h1><?=$model->name?></h1>
  36. <img src="<?=$model->getImg('2','jpg')?>" class="img-thumbnail rounded float-left mr-3 mb-2 person" alt="<?=$model->name?>">
  37. <h3><b><?=$model->jobtitle?></b></h3><br>
  38. <?=$model->description?>
  39. </section>
  40. </div>
  41. </div>
  42. </div>