Good Morning Kirby Family…
at this moment i’m gonna play a bit whit the structure
method and i’m trying to do this on a simple portfolio.
here is my code:
blueprint file:
portfolioitems:
label: Portfolio Items
type: line
portfolio:
label: Portfolio Images
type: structure
entry: >
{{image}}: {{projectname}} - ({{projecttitle}}) - ({{demoimage}})
fields:
image:
label: Full Image
type: image
demoimage:
label: Demo Image
type: image
projectname:
label: Project Name
type: text
projecttitle:
label: Project Title
type: text
my portfolio.php
snippet:
<?php $portfolio = $page->portfolio()->toStructure(); ?>
<?php foreach($portfolio as $portfolio): ?>
<div class="row">
<div class="portfolio-items">
<div class="col-sm-6 col-md-4 lorem">
<div class="portfolio-item">
<?php if($image = $portfolio->demoimage()->toFile()): ?>
<div class="hover-bg"> <a href="<?php echo $image->url() ?>" title="<?php echo $portfolio->projectname() ?>" data-lightbox-gallery="gallery1">
<?php endif ?>
<div class="hover-text">
<div class="overlay-caption">
<div class="overlay-content">
<h4>Project Name</h4>
</div>
</div>
</div>
<?php if($image = $portfolio->image()->toFile()): ?>
<img src="<?php echo $image->url() ?>" class="img-responsive" alt="<?php echo $portfolio->projecttitle() ?>"> </a> </div>
<?php endif ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
and in the template:
<!-- Portfolio Section -->
<div id="portfolio">
<div class="container">
<div class="section-title">
<h2><?= $page->portfolioheading()->html() ?></h2>
</div>
<?= snippet('portfolio') ?>
</div>
</div>
my problem is that the images have a wrong position it has to look like that:
but my result is that:
do you have any ideas what i do wrong?. the template that i use for that is Focus from templatewire
have a nice sunday