Skip to content

Instantly share code, notes, and snippets.

@briancribb
Created August 10, 2016 13:56
Show Gist options
  • Save briancribb/2e9f006e48d39c176ae0826cfaa052d4 to your computer and use it in GitHub Desktop.
Save briancribb/2e9f006e48d39c176ae0826cfaa052d4 to your computer and use it in GitHub Desktop.
Get the children of the current page and see if it has a child with a given name. NOTE: Mura functions and methods refer to children as "kids".
<cfset directChildren = $.content().getKidsQuery()>
<cfquery name="specificChild" dbtype="query">
SELECT * FROM directChildren WHERE title = 'My Specific Title';
</cfquery>
<cfif specificChild.recordCount neq 0>
<!--- The named child is present, so we'll do some stuff. --->
<cfelse>
<!--- Do nothing. --->
</cfif>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment