Created
November 24, 2012 10:53
-
-
Save vipickering/4139171 to your computer and use it in GitHub Desktop.
PHP: Kirby Post Type Detection
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 foreach($page->children()->visible() as $article): ?> | |
<article> | |
<?php if($article->template() == 'article.text'): ?> | |
<!-- put the HTML for the text post here --> | |
<div>text post</div> | |
<?php elseif($article->template() == 'article.video'): ?> | |
<!-- put the HTML for the video post here --> | |
<div>video post</div> | |
<?php elseif($article->template() == 'article.image'): ?> | |
<!-- put the HTML for the image post here --> | |
<div>image post</div> | |
<?php elseif($article->template() == 'article.link'): ?> | |
<!-- put the HTML for the link post here --> | |
<div>link post</div> | |
<?php elseif($article->template() == 'article.quote'): ?> | |
<!-- put the HTML for the quote post here --> | |
<div>quote post</div> | |
<?php endif ?> | |
</article> | |
<?php endforeach ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment