I’m having an issue with the functionality of the click-thru checkbox I made, The code is as follows but always rendering as truthy in the initial if statement.
foreach($page->children()->visible() as $item): ?>
<?php if ($item->clickthru()->value()=='turnon'): ?>
<li>
<a href="<?= $item->url() ?>">
<div class="portraitimg">
<?php
if ($i > 4) { $i = 1; }
if (($i == 1) || ($i == 4)) { $image = $item->horzimg()->toFile(); }
else { $image = $item->vertimg()->toFile(); }
if($image):
?>
<img src="<?= $image->url() ?>" alt="<?= $page->title()->html() ?>">
<?php endif ?>
<div class="text"><strong>View Project</strong></div>
</div>
<strong><?= $item->title()->html() ?></strong>
</a>
</li>
<?php else: ?>
<li>
<h1>Worked</h1>
<div class="portraitimg">
<?php
if ($i > 4) { $i = 1; }
if (($i == 1) || ($i == 4)) { $image = $item->horzimg()->toFile(); }
else { $image = $item->vertimg()->toFile(); }
if($image):
?>
<img src="<?= $image->url() ?>" alt="<?= $page->title()->html() ?>">
<?php endif ?>
<div class="text"><strong>View Project</strong></div>
</div>
<strong><?= $item->title()->html() ?></strong>
</li>
<?php endif ?>
<?php $i++; endforeach ?>