{layout='layouts/_blog-layout'} {!-- Redirect ============ This is a blog single entry page, it'll never need a fourth segment, so we use the following code to make sure the page redirects if someone types in an incorrect URL in the browser address bar, by adding new segments. i.e. http://example.com/blog/entry/title/nothing --} {if segment_4} {redirect='{segment_1}/{segment_2}/{segment_3}'} {/if} {!-- page vars (prefix p_) --} {preload_replace:p_title='My Blog'} {preload_replace:p_description='A blog about things, things I like and things I do.'} {preload_replace:p_url='blog'} {preload_replace:p_url_entry='entry'} {!-- channel vars (prefix ch_) --} {preload_replace:ch='blog'} {preload_replace:ch_disable='category_fields|member_data|pagination'} {!-- layout vars, channel/page related --} {layout:set name='ch' value='{ch}'} {layout:set name='p_url' value='{p_url}'} {layout:set name='p_title' value='{p_title}'} {!-- single-entry pagination --}
{exp:channel:prev_entry channel='{ch}'} Previous {/exp:channel:prev_entry} {exp:channel:next_entry channel='{ch}'} Next {/exp:channel:next_entry}
{!-- require_entry makes it so if someone types the wrong URL, they will get a 404 page --} {exp:channel:entries channel='{ch}' disable='{ch_disable}' limit='1' require_entry='yes'} {!-- layout vars, dynamic, not output --} {layout:set name='title' value='{seo_title}{gv_sep}{p_title}{gv_sep}'} {layout:set name='description' value='{seo_desc}'} {layout:set name='entry_ch' value='{ch}'} {!-- OpenGraph meta output --} {layout:set name='og_title' value='{seo_title}'} {layout:set name='og_url'}{path='{p_url}'}{/layout:set} {layout:set name='og_description' value='{seo_desc}'} {!-- /layout vars, dynamic, not output --} {!-- content output --}

{title}

{!-- video, youtube or vimeo? (GRID) --} {if blog_video} {blog_video} {if blog_video:type == 'youtube'}
{/if} {if blog_video:type == 'vimeo'}
{/if} {/blog_video} {/if} {!-- audio, soundcloud or bandcamp? (GRID) --} {if blog_audio} {blog_audio} {if blog_audio:type == 'soundcloud'}
{/if} {if blog_audio:type == 'bandcamp'}
{/if} {/blog_audio} {/if} {!-- image (GRID) --} {if blog_image} {blog_image}
{blog_image:caption:attr_safe}
{blog_image:caption}
{/blog_image} {/if} {!-- blog_content is a textarea with HTML output we don't need to wrap this tag with HTML as that is already included in it's output. --} {blog_content} {!-- /content output --} {!-- no results redirect =================== If the entry doesn't exist, we redirect to 404. This works in tandem with the require_entry='yes' parameter on the channel entries tag. --} {if no_results} {redirect='404'} {/if} {!-- comments comment:entries and comment:form are independent of channel:entries we've put them into a embed here to demonstrate how to get a specific display on the front end of the site using allow_comments. This would not work without the embed, as these tags would not parse inside the channel:entries tag. --} {if allow_comments} {embed='{p_url}/_comments' ch='{ch}'} {if:else} {if comment_total >= 1} {embed='{p_url}/_comments' ch='{ch}'} {/if}
{if comment_expiration_date < current_time AND comment_expiration_date != 0}

{gv_comment_expired}

{if:else}

{gv_comment_disabled}

{/if}
{/if} {/exp:channel:entries}