Let a thousand I.C.E. APIs bloom!

I.C.E. Widgets

I.C.E. Widgets (located in the ice\widgets folder) are custom functions that allow you to perform a variety of data retrieval and display tasks. I.C.E. comes with several widgets that help you easily implement Content, Login, Signup, Language, Translation, RSS, Tracking and API functions. Widgets accept Site parameters such as a Page_ID, Channel_ID, Site_ID, Site_Language_ID Site_Member_ID etc. and respond with data in query, XML or HTML format. For example, the page.cfm and page_xml.cfm widgets take Page_ID as a parameter and respond with content for that page in query and XML format respectively.

You use widgets in Channels (Index Template Code and Page Template Code fields) or in Containers used by those Channels and you do so by invoking the widget with a <cfmodule> or <cfinclude> statement and the required parameters as described below. You can create your own widgets or use the pre-built widgets that come with I.C.E. The pre-built widgets are as follows:

 

API Widget (ice/widgets/api.cfm)

The API Widget allows you to publish API documentation for a Site for which you've created a public API using the built in I.C.E. API Module. This widget takes the Site ID as a parameter and is called with the following statement:

<cfmodule template="../../../widgets/api.cfm" site_id="[SITE ID HERE]">

The API Widget responds with HTML containing the descriptions and instructions for the API and it's Components.

 

Channel Widget (ice/widgets/channel.cfm)

The Channel Widget allows you to retrieve data for all Channels belonging to a site or for an individual Channel. It takes the following parameters, Site_ID, Channel_ID, Max and Site_Language_ID and is retrieved with the following statements

<!--- All Active Channels in a Site --->
<cfmodule template="../../../widgets/channel.cfm" site_id="[SITE ID HERE]">

<!--- Individual Channel --->
<cfmodule template="../../../widgets/channel.cfm" channel_id="[CHANNEL ID HERE]">

<!--- All Active Channels in a Site in a specific language --->
<cfmodule template="../../../widgets/channel.cfm" site_id="[SITE ID HERE]" site_language_id="[SITE LANGUAGE ID HERE]">

<!--- Limit Channels Returned --->
<cfmodule template="../../../widgets/channel.cfm" site_id="[SITE ID HERE]" max="5">

The Channel Widget returns a query variable called session.channel

 

Channel XML Widget (ice/widgets/channel_xml.cfm)

The XML version of the Channel Widget returns Channel info in XML format. See examples above and replace channel.cfm with channel_xml.cfm to get results in XML format.

 

The Channel XML Widget returns an XML variable called session.channel_xml

 

Page Widget (ice/widgets/page.cfm)

The Page Widget allows you to retrieve data for all Pages belonging to a Channel or for an individual Page. It takes the following parameters, Site_ID, Channel_ID, Page_ID, Max and Site_Language_ID and is retrieved with the following statements

<!--- All Active Pages in a Channel --->
<cfmodule template="../../../widgets/page.cfm" channel_id="[CHANNEL ID HERE]">

<!--- Individual Page --->
<cfmodule template="../../../widgets/page.cfm" page_id="[PAGE ID HERE]">

<!--- All Active Pages in a Channel in a specific language --->
<cfmodule template="../../../widgets/page.cfm" channel_id="[CHANNEL ID HERE]" site_language_id="[SITE LANGUAGE ID HERE]">

<!--- Limit Pages Returned --->
<cfmodule template="../../../widgets/page.cfm" channel_id="[CHANNEL ID HERE]" max="5">

The Page Widget returns a query variable called session.page

 

Page XML Widget (ice/widgets/page_xml.cfm)

The XML version of the Page Widget returns Page info in XML format. See examples above and replace page.cfm with page_xml.cfm to get results in XML format.

Note: The Page XML Widget returns all Media associated with a Page so there's no need to use the Media Widget to retrieve media for the Page as is required with the Page Widget. See below for the Media Widget.

The Page XML Widget returns an XML variable called session.page_xml

 

Media Widget (ice/widgets/media.cfm)

The Media Widget can be used alone or with the Page widget to retrieve media associated with any page. The widget takes a single parameter Page_ID and returns all Media associated with a Page.

<cfmodule template="../../../widgets/media.cfm" page_id="[PAGE ID HERE]">

The Media Widget returns several query variables for each media type called session.page_image, session.page_video, session.page_flash, session.page_audio and session.page_document.

 

Languages Widget (ice/widgets/languages.cfm)

The Languages Widget is typically used in the header of a multi-lingual Site to allow site users to switch to their preferred language. It takes two parameters: ID and Site_ID. Called with Site_ID, it returns all languages available for the site in a query object. Any part of this query object can be used to impement multi-language features for the Site. Called with ID (a language ID), it returns info about the current Language which can be used to switch languages for the user. You can use the ID field returned in the query object to set session.my_language_id which is the language of the current user.

<cfmodule template="../../../widgets/languages.cfm" site_id="[SITE ID HERE]">

The Languages Widget returns a query variable called session.languages

 

Translate Widget (ice/widgets/translate.cfm)

The Translate Widget is used to translate static text in Containers. It takes 3 non-optional parameters: Container, Site_ID and Site_Language_ID. It returns all labels for a specific Container belonging to a specifc Site in a Specific Language in a comma delimited list, the members of which can be used to replace any static text in a container.

<cfmodule template="../../../widgets/translate.cfm" container="CONTAINER NAME WITH EXTENSION HERE" site_id="[SITE ID HERE]" site_language_id="SITE LANGUAGE ID HERE">

The Translate Widget returns a comma-separated list variable called session.label

<!--- Output First Label --->
<cfoutput>#listgetat(session.label,1)#</cfoutput>

<!--- Output Second Label --->
<cfoutput>#listgetat(session.label,2)#</cfoutput>


 

 RSS Widget (ice/widgets/rss.cfm)

The RSS Widget is used to retrieve all internal RSS Feeds created using the built-in I.C.E. RSS Module. You can use this widget to create a single page listing all your RSS Feeds. The widget returns HTML and data and doesn't need any parameters. Instead, it uses the Site's ID to generate the Feeds. 

<cfmodule template="../../../widgets/rss.cfm">

 

RSS Schedule Widget (ice/widgets/rss_schedule.cfm)

The RSS Schedule Widget is used to retrieve data for all external RSS feeds created using the built-in I.C.E. RSS Module and store that data as a Page. The widget takes a URL parameter site_id. You can use this widget by setting up a Scheduled Task (that runs with your preferred frequency) in the Coldfusion Administrator that calls the following URL:

http://[ICE URL HERE]/widgets/rss_schedule.cfm?site_id=[YOUR SITE ID HERE]

 

Stats Widget (ice/widgets/stats.cfm)

The Stats Widget lets you use the I.C.E. Web Site Analytics (WSA) Module to track page views and visits to the site. Used in conjunction with the I.C.E. CRM Module for Site Member management this widget gives you valuable insight into your Site Members' content preferences. The Stats Widget doesn't return any data but passed data directly into the WSA module. To track stats for a site, simply include the Stats Widget in the site's global footer or header using the following statement:

<cfinclude template="../../../widgets/stats.cfm">

 

Note: CRM Widgets Login.cfm, Logout.cfm, Register.cfm, Profile.cfm are covered in the CRM Module Documentation



DEMO (Beta)

Don't take our word for it. Try Lingxia 273 I.C.E. content managent system now: (Contact us to access the demo with Admin privileges)

E-mail:


Password:


DOWNLOAD IT!