Last active
August 29, 2015 14:13
-
-
Save pauldenato/9ddf07f92ba159a34d0b to your computer and use it in GitHub Desktop.
Get all Display Objects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- //Drop this in the theme or site contentrenderer.cfc ---> | |
<cffunction name="getPageDisplayObjects" output="no" returntype="query"> | |
<cfargument name="ContentHistID" required="yes"> | |
<cfargument name="siteID" required="no"> | |
<cfset getDisplayObjects = '' /> | |
<cfquery name="getDisplayObjects" datasource="#application.configBean.getDatasource()#"> | |
select ContentHistID,ObjectID,Object,ContentID,Name,OrderNo,SiteID,ColumnID,Params | |
from tcontentobjects | |
where ContentHistID = <cfqueryparam cfsqltype="cf_sql_varchar" value="#trim(arguments.ContentHistID)#" /> and | |
SiteID = <cfqueryparam cfsqltype="cf_sql_varchar" value="#trim(arguments.siteID)#" /> | |
</cfquery> | |
<cfreturn getDisplayObjects> | |
</cffunction> | |
<!--- //Place this in a template or dsp_getTheObjects.cfm and then a component. ---> | |
<cfset qryTheObjects = $.getPageDisplayObjects($.content('contentHistID'),$.content().getValue('siteid')) /> | |
<cfloop query="qryTheObjects"> | |
<!---<cfif qryTheObjects.name contains '{object name}'>---> | |
<!---conditional code here---> | |
#qryTheObjects.name# | |
<!---</cfif> ---> | |
</cfloop> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment