ReadabilitySpecifying an external source for the CFPOD tag in ColdFusion
The following example shows how you can specify an external URL by setting the source
attribute on a CFPOD tag in ColdFusion.
And the external .CFM document, getRSS.cfm, is as follows:
RSS feed URL not specified!
And the output of the <CFPOD> tag is as follows:
The following example shows how you can specify an external URL by setting the source
attribute on a CFPOD tag in ColdFusion.
<cfpod title="ColdFusion Examples RSS Feed"
source="getRSS.cfm?feed=http://coldfusionexamples.com/feed/"
width="400" height="100" />
<br />
<cfpod title="dHTML Examples RSS Feed"
source="getRSS.cfm?feed=http://dhtmlexamples.com/feed/"
width="400" height="100" />
<br />
<cfpod title="ActionScript Examples RSS Feed"
source="getRSS.cfm"
width="400" height="100" /> |
<cfpod title="ColdFusion Examples RSS Feed"
source="getRSS.cfm?feed=http://coldfusionexamples.com/feed/"
width="400" height="100" />
<br />
<cfpod title="dHTML Examples RSS Feed"
source="getRSS.cfm?feed=http://dhtmlexamples.com/feed/"
width="400" height="100" />
<br />
<cfpod title="ActionScript Examples RSS Feed"
source="getRSS.cfm"
width="400" height="100" />
And the external .CFM document, getRSS.cfm, is as follows:
<cfif NOT structKeyExists(URL, "feed")>
<h2>RSS feed URL not specified!</h2>
<cfabort />
</cfif>
<cffeed action="read"
source="#URL.feed#"
query="rssFeed" />
<ul>
<cfoutput query="rssFeed">
<li>[#dateFormat(rssFeed.publishedDate)#] <a href="#rssFeed.rssLink#">#rssFeed.title#</a></li>
</cfoutput>
</ul> |
<cfif NOT structKeyExists(URL, "feed")>
<h2>RSS feed URL not specified!</h2>
<cfabort />
</cfif>
<cffeed action="read"
source="#URL.feed#"
query="rssFeed" />
<ul>
<cfoutput query="rssFeed">
<li>[#dateFormat(rssFeed.publishedDate)#] <a href="#rssFeed.rssLink#">#rssFeed.title#</a></li>
</cfoutput>
</ul>
And the output of the <CFPOD> tag is as follows:
Just a bunch of ColdFusion examples