person.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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"=>$model->getUrl()
  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('_sizehd','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('_size2','jpg', true), $model->getUrl(true), '');
  24. $i = 1;
  25. foreach($this->params['breadcrumbs'] as $el){
  26. jsonLD::addBreadcrumb($i, $el['url'], $el['text']);
  27. $i++;
  28. }
  29. ?>
  30. <style>
  31. .person td{border-left:2px solid #eee}
  32. .container4 {
  33. column-count: 3;
  34. column-rule:2px solid #eee;
  35. column-gap: 20px;
  36. }
  37. .photo_author{
  38. }
  39. </style>
  40. <div class="row justify-content-md-center person">
  41. <div class="col-md-10">
  42. <?=$this->render("/layouts/breadcrumbs")?>
  43. <div id="post" class="post">
  44. <section class="text">
  45. <div style="background-image: url(<?=$model->getImg('_sizehd','jpg')?>);width:100%;height:100%;background-size: cover;padding: 10px;color: white;text-shadow: 1px 1px #6c6c6c;aspect-ratio: 16/9;background-position-x: center;">
  46. <div style="background:#111;opacity: 0.4;;padding: 20px;width: min-content;">
  47. <h1><?=$model->name?></h1>
  48. <?/* <img src="<?=$model->getImg('_size2','jpg')?>" class="img-thumbnail rounded float-left mr-3 mb-2 person" alt="<?=$model->name?>">*/?>
  49. <h4><b><?=$model->jobTitle?></b></h4><br>
  50. <?=$model->description?>
  51. </div>
  52. </div>
  53. </section><br>
  54. <h2><img src="<?=$model->getImg('_sizesq2','jpg')?>" style="border-radius: 50%;box-shadow: 0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23) !important;margin-right: 10px;" width="64px" height="64px">Последнии материалы автора</h2>
  55. <?=$this->render("/layouts/lenta/lenta_test", ['author'=>$model->id])?>
  56. <h2>about</h2>
  57. <?=$model->text?>
  58. </div>
  59. </div>
  60. </div>