Hi
Can someone help me with combining these to code snippets. They both work separately but I would like to be able to show the videos and images in the same loop and use anchor tags to navigate in the website…
Using images from one page in a loop
<?php $n = 0; foreach(page('heroes')->files()->sortBy('sort', 'asc') as $image) : $n++; ?>
<?php if($n == page('heroes')->files()->count()): ?>
<a href="#1" id="<?php echo $n ?>">
<?php else: ?>
<a href="#<?php echo $n +1 ?>" id="<?php echo $n ?>">
<?php endif ?>
<div class="parent">
<div class="child">
<img src="<?php echo $image->url() ?>">
</div>
</div>
</a>
Grabbing vimeolinks
<?php foreach(page('heroes')->vimeolinks()->yaml() as $vimeovid): ?>
<div class="parent">
<div class="child">
<?php echo vimeo($vimeovid['vimeoid']) ?>
</div>
</div>
<?php endforeach ?>
I guess easiest will be to show either the videos or the images first, don’t know how i will be able to mix them…