Skip to content

Commit

Permalink
Don't show current page as available parent page
Browse files Browse the repository at this point in the history
  • Loading branch information
mklkj committed Nov 8, 2018
1 parent 2bba497 commit 40e25b7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions templates/pages-one.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@
<select class="custom-select" id="parent_id" name="parent_id">
<option value="0">(brak)</option>
<?php foreach ($this->pages() as $key => $value): ?>
<option <?= ($value['id'] == $this->page->parentID()) ? 'selected="selected" ' : ''; ?>
value="<?= $value['id']; ?>">
<?= $value['title']; ?></option>
<?php if ($value['id'] !== $this->page->id()): ?>
<option <?= ($value['id'] == $this->page->parentID()) ? 'selected="selected" ' : ''; ?>
value="<?= $value['id']; ?>">
<?= $value['id']; ?> - <?= $value['title']; ?>
</option>
<?php endif; ?>
<?php endforeach; ?>
</select>
</div>
Expand Down

0 comments on commit 40e25b7

Please sign in to comment.