Latest Sermons
To show the latest sermon(s) on the homepage, add the following Coldfusion code.
Note: Update the Feed URL to a feed from the website's OneCast account. This is typically from a specific Channel as shown:
Coldfusion Code
Update the request.watch_page
, request.video_max
, and request.video_feedurl
variables. Adjust the HTML as needed.
<div class="sermons-container">
<h2>Latest<br><strong>sermons</strong></h2>
<div class="sermon-blocks">
<cfset request.watch_page = "/watch">
<cfset request.video_max = 3>
<cfset request.video_feedurl = "https://media.perpetuatech.com/feeds/category/f/MzQxMTRGOTEzNA">
<cfhttp url="#request.video_feedurl#?limit=#request.video_max#" method="GET" resolveURL="yes" />
<cfset request.feed_xml_raw = cfhttp.fileContent>
<cfif IsXml(request.feed_xml_raw)>
<cfset request.feed_xml = XmlParse(request.feed_xml_raw)>
<cfset request.video_count = 0>
<cfloop array="#request.feed_xml.rss.channel.item#" index="request.video_info">
<cfset request.video_count++>
<cfoutput>
<div class="sermon_block">
<a href="#request.watch_page#?v=#request.video_info.guid.XmlText#">
<img src="#request.video_info.thumbnail.XmlAttributes.url#">
</a>
<div class="sermon-info">
<p>#DateFormat(request.video_info.pubDate.XmlText, "mmm dd, yyyy")#</p>
<h3>
<a href="#request.watch_page#?v=#ListLast(request.video_info.guid.XmlText, '/')#">#request.video_info.title.XmlText#</a>
</h3>
</div>
</div>
<cfif val(request.video_max) and val(request.video_count) GTE val(request.video_max)>
<cfbreak>
</cfif>
</cfoutput>
</cfloop>
</cfif>
</div>
<a href="<cfoutput>#request.watch_page#</cfoutput>" class="btn blue">More</a>
</div>
subpages
- Auto Display Page Title
- Blog
- CSS Animations
- Drop Down Menu
- Email Subscription
- Google Fonts
- Google Maps API
- Header Videos
- Instagram Feed
- Layout Override
- On-Page Nav Scrolling
- Onecast / Latest Sermon
- Page Content
- Page Content Edit Buttons
- Parallax Scrolling
- Per Page SEO
- Permalink Conversion
- Popup Box
- Rotator / Event Box
- Sidebar Pop-out
- Site Search
- Slider
- Social Media Icons
- Split Navigation
- Staff Module
- Subpage Module
- TinyMCE Content Editor
- Twitter Feed
- Deprecated Add Ons