Skip to content

Instantly share code, notes, and snippets.

@DZuz14
Created December 15, 2016 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DZuz14/d6aff98765e1c58b063a19499d24daf7 to your computer and use it in GitHub Desktop.
Save DZuz14/d6aff98765e1c58b063a19499d24daf7 to your computer and use it in GitHub Desktop.
Zen dropdown
// The below command is creating a variable that loads the 'departures' template, and loads its children.
// I am curious as to where the date is getting it's instructions on how to display itself.
// Hoping you can shed some light onto the subject.
$departures = $page->get('template=departures')->children('template=departure');
<div class="ctaBox-departure">
<label for="departure">
<?=__('Departure Date')?>: </label>
<select name="departure">
<? foreach($departures as $departure): ?>
<? if(!$departure->isClosed()): ?>
<option value="<?= $departure->id ?>"> <?= $departure->departure_date ?> (<?= renderPrice($departure->getPrice()) ?>)</option>
<? endif ?>
<? endforeach ?>
</select>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment