Commit f82868eeb43e93b072c2c491a5a31cbd63b64019
1 parent
1bb3eff2
blog changes from server
Showing
2 changed files
with
18 additions
and
11 deletions
Show diff stats
frontend/views/blog/_article_item.php
| ... | ... | @@ -53,7 +53,7 @@ |
| 53 | 53 | </p> |
| 54 | 54 | </div> |
| 55 | 55 | </div> |
| 56 | - <div class="image" style="height: 352px;"> | |
| 56 | + <div class="image" <?php if ($model->lang->image) echo 'style="height: 352px"'?>;> | |
| 57 | 57 | <a |
| 58 | 58 | href="<?=Url::toRoute( |
| 59 | 59 | [ |
| ... | ... | @@ -62,11 +62,15 @@ |
| 62 | 62 | ] |
| 63 | 63 | )?>" |
| 64 | 64 | > |
| 65 | - <?=$model->lang->image->getImg( | |
| 66 | - [ | |
| 67 | - 'class' => "img-responsive" | |
| 68 | - ] | |
| 69 | - )?> | |
| 65 | + <?php | |
| 66 | + if ($model->lang->image) { | |
| 67 | + echo $model->lang->image->getImg( | |
| 68 | + [ | |
| 69 | + 'class' => "img-responsive" | |
| 70 | + ] | |
| 71 | + ); | |
| 72 | + } | |
| 73 | + ?> | |
| 70 | 74 | </a> |
| 71 | 75 | </div> |
| 72 | 76 | <p class="intro"> | ... | ... |
frontend/views/blog/view.php
| ... | ... | @@ -45,11 +45,14 @@ |
| 45 | 45 | <div id="post-content" class="post-blog"> |
| 46 | 46 | |
| 47 | 47 | <p> |
| 48 | - <?= $article->lang->image->getImg( | |
| 49 | - [ | |
| 50 | - 'class' => "img-responsive", | |
| 51 | - ] | |
| 52 | - ) ?> | |
| 48 | + <?php if ($article->lang->image) { | |
| 49 | + echo $article->lang->image->getImg( | |
| 50 | + [ | |
| 51 | + 'class' => "img-responsive", | |
| 52 | + ] | |
| 53 | + ); | |
| 54 | + } | |
| 55 | + ?> | |
| 53 | 56 | </p> |
| 54 | 57 | |
| 55 | 58 | <?= $article->lang->body ?> | ... | ... |