Skip to content

Instantly share code, notes, and snippets.

@kmgdevelopment
Last active December 22, 2015 07:59
Show Gist options
  • Save kmgdevelopment/6441951 to your computer and use it in GitHub Desktop.
Save kmgdevelopment/6441951 to your computer and use it in GitHub Desktop.
{!-- if the template is requested with Ajax, return JSON data. Otherwise, display a normal page --}
{if ajax}
{exp:http_header content_type='application/json'}
{"success": {if error == 1}false{if:else}true{/if}, "heading": "{heading}", "message": "{exp:low_replace find='NEWLINE'}{content}{/exp:low_replace}"}
{/if}
{if not_ajax}
{embed='_global/document_head' page_title='{heading}'}
<body class="single">
{header}
<article class="bizness">
<header>
<h1>{heading}</h1>
</header>
{content}
{link}
</article>
{footer}
{global_scripts}
{document_foot}
{/if}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment