Skip to content

Instantly share code, notes, and snippets.

@erutan
Created March 11, 2014 21:18
Show Gist options
  • Save erutan/9495295 to your computer and use it in GitHub Desktop.
Save erutan/9495295 to your computer and use it in GitHub Desktop.
{embed="site/header" my_page_title="{exp:channel:entries channel="blog" limit="1"}{title}{/exp:channel:entries}"}
{if segment_2==""}
<h2>Blog Posts</h2>
{exp:channel:entries
channel="blog"
limit="10"
dynamic="no"
}
<h3><a href="{url_title_path='blog'}">{title}</a></h3>
{exp:trunchtml chars="400" inline="..." ending="<a href='{path=blog}/{url_title}'>read more</a>"}
{blog_post}
{/exp:trunchtml}
<hr>
{/exp:channel:entries}
{if:else}
{exp:channel:entries
channel="blog"
disable="categories|category_fields|member_data|pagination"
limit="1"
url_title="{segment_2}"
}
<section class="blog">
<article>
<h2>{title}</h2>
{blog_post}
<ul>
{related_excerpts}
<li><a href="{path="excerpts"}/{related_excerpts:url_title}">"{related_excerpts:title}"</a></li>
{/related_excerpts}
</ul>
</article>
<aside>
<h4>Blog Posts</h4>
<ul>
{exp:channel:entries channel="blog" limit="10"}
<li><a href="{url_title_path='blog'}">{title}</a></li>
{/exp:channel:entries}
</ul>
</aside>
</section>
{/exp:channel:entries}
{/if}
{embed="site/footer"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment