-
-
Save craigrodway/ca9b98d503bf7b51f151 to your computer and use it in GitHub Desktop.
ProcessWire photos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php include("./head.inc"); ?> | |
<div class="grid_12 content"> | |
<h1><?php echo $page->title ?></h1> | |
<p><?php echo $page->summary ?></p> | |
<div class="photo-wrapper clearfix photos"> | |
<?php $photos = wire("page")->photos; ?> | |
<?php foreach ($photos as $photo): ?> | |
<div class="photo single"> | |
<a href="<?php echo $photo->size(1024)->url ?>" title="<?php echo $photo->description ?>"> | |
<img class="max-img border-primary" src="<?php echo $photo->size(260, 260)->url ?>" alt="<?php echo $photo->description ?>"> | |
</a> | |
</div> | |
<?php endforeach; ?> | |
</div> | |
</div> | |
<script> | |
Q.push(function() { | |
$(document).ready(function() { | |
var photoswipe = $(".photos a").photoSwipe({ | |
enableMouseWheel: false, | |
enableKeyboard: true, | |
allowUserZoom: false, | |
imageScaleMethod: "fitNoUpscale" | |
}); | |
}); | |
}); | |
</script> | |
<?php include("./foot.inc"); ?> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php include("./head.inc"); ?> | |
<div class="grid_12 content"> | |
<div class="photo-wrapper clearfix"> | |
<?php $albums = wire("pages")->find("parent=/photos/, template=photos, sort=-created"); ?> | |
<?php foreach($albums as $album): ?> | |
<div class="photo"> | |
<a href="<?php echo $album->url ?>"> | |
<img class="max-img" src="<?php echo $album->photos->first()->size(260, 260)->url ?>"><!-- | |
--></a> | |
<br> | |
<h6 class="title"><strong><?php echo $album->title ?></strong></h6> | |
<p class="when"><?php echo date('j F Y', $album->created) ?></p> | |
</div> | |
<?php endforeach; ?> | |
</div> | |
</div> | |
<?php include("./foot.inc"); ?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment