Last active
September 18, 2015 17:34
-
-
Save howellcc/167bc9f75702571d3811 to your computer and use it in GitHub Desktop.
[MuraCMS] - Public display of a plugin's display object with fallback.
This file contains 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
<!--- In this example, MuraTweets is a plugin and TwitterTile is one of its display objects. | |
In my experience, this method of referencing the display will fail once in a blue moon. Usually | |
fixable by simply doing an application reload. This snippet supplies a fallback in case, for some | |
reason, the plugin isn't registered within the MuraScope. ---> | |
<cftry> | |
#$.MuraTweets.TwitterTile($)# | |
<cfcatch type="any"> | |
<cfset qryDisplayObjects = application.pluginManager.getDisplayObjectsBySiteID(siteID=$.event('siteID'))> | |
<cfquery name="muraTweetsTwitterTile" dbtype="query"> | |
select * from qryDisplayObjects | |
where displayMethod = 'TwitterTile' | |
</cfquery> | |
<cfif muraTweetsTwitterTile.recordCount eq 1> | |
#$.dspObject(object="plugin",objectID=muraTweetsTwitterTile.objectID)# | |
</cfif> | |
</cfcatch> | |
</cftry> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment