Skip to content

Instantly share code, notes, and snippets.

@erictompkins
Last active November 11, 2016 11:50
Show Gist options
  • Save erictompkins/9d57b416ad34e454b69a2f25ea659eeb to your computer and use it in GitHub Desktop.
Save erictompkins/9d57b416ad34e454b69a2f25ea659eeb to your computer and use it in GitHub Desktop.
BranchCMS Trails App :: Content Layout to process the POST AJAX submission and call the correct APIs
{if #global.request.post.id}
{if #global.request.post.id isArray}
{#global.request.post.id|implode glue="," output="no" saveAs="id"}
{else}
{#id|set value="{#global.request.post.id}"}
{/if}
{if #id}
{ap_api:trails:trailFilter templateId="35" getTowns="yes" getCategories="no" getCounties="no" getContacts="no" getFeatures="no" getSegments="no" instanceKey="trails" attr[id]="{#id}"}
{/if}
{elseif #global.request.get.id}
{if #global.request.get.id isArray}
{#global.request.get.id|implode glue="," output="no" saveAs="id"}
{else}
{#id|set value="{#global.request.get.id}"}
{/if}
{if #id}
{ap_api:trails:trailFilter templateId="35" getTowns="yes" getCategories="no" getCounties="no" getContacts="no" getFeatures="no" getSegments="no" instanceKey="trails" attr[id]="{#id}"}
{/if}
{/if}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment