Skip to content

Commit

Permalink
Improve post img tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Usbac committed Sep 7, 2024
1 parent ee85cec commit 92acd42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions app/languages/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
'post' => 'Post',
'post_code' => 'Posts code',
'post_code_description' => 'Code here will be injected at the bottom of all post pages. Useful for things like adding a comment system.',
'post_image' => 'Post image',
'posts' => 'Posts',
'publish_date' => 'Publish date',
'published' => 'Published',
Expand Down
6 changes: 1 addition & 5 deletions app/views/admin/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@
<label for="title"><?= t('title') ?></label>
<input id="title" type="text" name="title" value="<?= e($post['title'] ?? '') ?>" data-char-count/>
</div>
<?php if (!empty($post['image'])): ?>
<img src="<?= e($this->getContentUrl($post['image'])) ?>" class="pointer post-image"/>
<?php else: ?>
<img src="/public/assets/no-image.svg" class="pointer post-image empty-img"/>
<?php endif ?>
<img src="<?= e(!empty($post['image']) ? $this->getContentUrl($post['image']) : '/public/assets/no-image.svg') ?>" class="pointer post-image <?php if (empty($post['image'])): ?>empty-img<?php endif ?>" alt="<?= t('post_image') ?>"/>
<input id="post-image-input" type="hidden" name="image" value="<?= e($post['image'] ?? '') ?>"/>
</div>
<textarea id="html" name="html"><?= $post['html'] ?? '' ?></textarea>
Expand Down

0 comments on commit 92acd42

Please sign in to comment.