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

Create New Channel

Understanding how Channels work is vital to making the most of the I.C.E. Content Management System. Channels are sections of a site. Example channels for a corporate site would be Home Page, Services, Products, Company News etc. Example channels for a Facebook application would be Profile, Friends, Photos etc.

 

Create New Channel

To Create a new Channel, select Channel in the Create drop-down list. Enter a Channel and Folder/Filename (single word with no extention), and select a Channel Type.

There are 3 Channel Types: Home Page, Other Channel  and Newsletter. If the Channel you are creating is the site's homepage, select Home Page, otherwise select Other Channel. The Newsletter Channel Type is for using the CMS to create Newsletters for the CRM module.

 

Channel Templates

Channels can have 2 distinct sets of HTML code or templates. The Index Template Code field holds the HTML code and dynamic content code for a Channel's Index (main page) and the Page Template Code holds the HTML and dynamic content code for an individual page assigned to that Channel.

Depending on the nature of your site you may use only the Index Template Code field or both. E.g. a news portal would place HTML code in the Index Template Code field that lists the latest headlines for a  Sports channel and place HTML code in the Page Template Code for pages that display individual stories. On the other hand a Facebook application might use only the Index Template Code field because that Channel doesn't link to indivdual pages of content. Additionally, whatever you insert in the Index Template Code field will be used to display or publish the Channel page and whatever you insert in the Page Template Code field will be used to display publish individual content pages belonging to that channel.

In short, Index Template Code and Page Template Code determine the look and feel of your site pages on a channel by channel basis.

 

What type of Channel?

I.C.E. is designed with flexibility in mind, allowing you to create any type of website. You can determin the look and feel of Channels by using the Index Template Code and Page Template Code fields in 3 ways:

1. HTML Code Only

No content is retrieved from the database. The HTML code entered in Index Template Code field of the channel determines the look and feel of the channel and also contains the content. Use this method for Channels containing Flash or for simple static sites that don't store content in the database. You do not use the Page Template Code field when creating this type of channel.

2. HTML Code & Dynamic Content

Content is stored in the database by creating Pages assigned to the Channel. You insert the HTML code for the Channel in the Index Template Code and/or Page Template Code fields. Within that HTML code you retrieve and output content dynamically using the provided I.C.E. Content Widgets. See Use I.C.E. Content Widgets below.

3. Container Includes

In order to optimize code reuse, you can include Containers (see Create New Container) that contain HTML code and/or dynamic content code in the Index Template Code and Page Template Code fields. This approach allows you to re-use Containers in different channels and to easily propagate code changes across the site later, by simply editing a Container.

Let's say you have created global header, body and footer Containers called Header.cfm, Body.cfm and Footer.cfm respectively and you want to use them in a Channel. You include them in the Index Template Code or Page Template Code fields of your Channel using the following line:

Code: 

<cfinclude template="../containers/Header.cfm">
<cfinclude template="../containers/Body.cfm">
<cfinclude template="../containers/Footer.cfm"> 

Save the Channel and preview it by clicking the channel name. You'll see that the page now displays the HTML in your Header, Body and Footer Containers. Of course the Containers must exist, otherwise the Channel will throw a not found error.

 

Displaying Database Content

As mentioned above, including Containers in Channels rather than inserting HTML code directly has many advantages. However, if you need to add HTML code directly to a Channel and the page needs to display Page content from the I.C.E. database, you can do so in 2 ways:

  1. Using I.C.E. Content Widgets
  2. Querying the I.C.E. database directly

 

1. Using I.C.E. Content Widgets

I.C.E. comes with several pre-built content Widgets that you can use in your HTML to display dynamic content. Content Display Widgets include channel.cfm, channel_xml.cfm, page.cfm and page_xml.cfm. These widgets are located in the /widgets folder under the I.C.E. root folder and can be called directly inside your HTML code.

The Content Widgets:

A. channel.cfm

Retrieve channel content as a query variable called 'session.channel'

B. page.cfm

Retrieve page content as a query variable called 'session.page'

C. channel_xml.cfm

Retrieve channel content as an xml variable called 'session.channel_xml'

D. page_xml.cfm

Retrieve page content as an xml variable called 'session.page_xml'

Note: The XML variable options are for pages coded in non-Coldfusion languages. Developers can use another programming language ASP, JSP or PHP code to manipulate the content returned in the XML variable.

 

Using the Content Widgets to Retrieve Content

Code Example: [Channel Widget with all Parameters] 

<cfmodule template="../../../widgets/channel.cfm" site_id="[SITE_ID]" channel_id="[CHANNEL_ID]" page_id="[PAGE_ID_HERE]" max="[MAXIMUM RESULTS]"  site_language_id="[SITE_LANGUAGE_ID]" >

Note: Usage of the parameters site_id, channel_id, page_id, max and site_language_id depends on what you are trying to do. Parameters may be hard coded or based on URL variables that are available to the page containing the code. The default max value is 10 and should be specified to display more than 10. Results are ordered by Rank ascending.

 

  • Retrieve and display all Channels belonging to current Site

<!--- Retrieve all Channels belonging to a Site --->
<cfmodule template="../../../widgets/channel.cfm" site_id="#url.sid#" >
<!--- Retrieve all Channels belonging to a Site --->

<!--- Dump the query results to see which variables are available --->
<cfdump var="#session.channel#">

<!--- Dump the query results to see which variables are available --->

<!--- Selectively Display or Output Channel Data --->
<cfoutput query="session.channel">
Channel ID: #id#
Channel: #ice_channel#
Site ID: #ice_site_id#
Published File: #published_file#
</cfoutput>
<!--- Selectively Display or Output Channel Data --->

 

  •  Retrieve and display data for current Channel

<!--- Retrieve current Channel data --->
<cfmodule template="../../../widgets/channel.cfm" channel_id="#url.cid#" >
<!--- Retrieve current Channel data --->

 <!--- Dump the query results to see which variables are available --->
<cfdump var="#session.channel#">

<!--- Dump the query results to see which variables are available --->

<!--- Selectively Display or Output Channel Data --->
<cfoutput query="session.channel">
Channel ID: #id#
Channel: #ice_channel#
Site ID: #ice_site_id#
Published File: #published_file#
</cfoutput>
<!--- Selectively Display or Output Channel Data --->

 

  • Retrieve and display all Channels based on current site language [Multi-lingual Sites Only]

<!--- Retrieve all Channels belonging to a Site based on Current Language --->
<cfmodule template="../../../widgets/channel.cfm" site_id="#url.sid#"  site_language_id="#session.my_language_id#">
<!--- Retrieve all Channels belonging to a Site based on Current Language --->

OR

<!--- Retrieve all Channels belonging to a Site based on Current Language --->
<cfmodule template="../../../widgets/channel.cfm" site_id="#url.sid#"  site_language_id="[SITE LANGUAGE ID]">
<!--- Retrieve all Channels belonging to a Site based on Current Language --->

 

 


 Note: You can also hand-code variables such as channel_id, page_id etc.. You can find IDs by browsing Sites, Channels Pages etc. A typical use of the channel.cfm widget is to programatically create site menus.

Code Example: [Channel XML Widget] 

The channel_xml.cfm widget returns an XML object called session.channel_xml. Running the cfdump code above will show you the structure of the object allowing you to use Coldfusion or another programming language to access the object's children.

<!--- Retrieve all Channels belonging to a Site --->
<cfmodule template="../../../widgets/channel_xml.cfm" site_id="#url.sid#" >
<!--- Retrieve all Channels belonging to a Site --->

<!--- Dump the query results to see which variables are available --->
<cfdump var="#session.channel_xml#">

<!--- Dump the query results to see which variables are available --->
 

Code Example: [Page Widget]

The page.cfm widget gives you incredibly flexibility by allowing you to output full page content or headline type lists in the Index Template Code or Page Template Code fields of a Channel. All page content entered using the New Page form is available via this widget and can be accessed on a Site, Channel or individual page basis. Some examples below:
 

  • Retrieve and display all pages belonging to a Site

<!--- Retrieve all Pages belonging to a Site --->
<cfmodule template="../../../widgets/page.cfm" site_id="#url.sid#" >
<!--- Retrieve all Pages belonging to a Site --->

<!--- Dump the query results to see which variables are available --->
<cfdump var="#session.page#">

<!--- Dump the query results to see which variables are available --->

<!--- Selectively Display or Output Page Data --->
<cfoutput query="session.page">
Page ID: #id#
Page Title: #ice_page#
Channel ID: #ice_channel_id#
Site ID: #ice_site_id#
Published File: #published_file#
</cfoutput>
<!--- Selectively Display or Output Page Data --->

 

  • Retrieve and display all pages belonging to a Channel

<!--- Retrieve all Pages belonging to a Channel --->
<cfmodule template="../../../widgets/page.cfm" channel_id="#url.cid#" >
<!--- Retrieve all Pages belonging to a Channel --->

<!--- Dump the query results to see which variables are available --->
<cfdump var="#session.page#">

<!--- Dump the query results to see which variables are available --->

<!--- Selectively Display or Output Page Data --->
<cfoutput query="session.page">
Page ID: #id#
Page Title: #ice_page#
Channel ID: #ice_channel_id#
Site ID: #ice_site_id#
Published File: #published_file#
Meta Title: #meta_title#
Meta Description: #meta_description#
Meta Keyword:  #meta_keyword#
Rank: #rank#
Link Text: #link_text#
Created: #created#

</cfoutput>
<!--- Selectively Display or Output Page Data --->

 

 

  • Retrieve content for a specific Page

<!--- Retrieve Content for a specific Page --->
<cfmodule template="../../../widgets/page.cfm" page_id="#url.pid#" >
<!--- Retrieve Content for a specific Page --->

<!--- Dump the query results to see which variables are available --->
<cfdump var="#session.page#">

<!--- Dump the query results to see which variables are available --->

<!--- Selectively Display or Output Page Data --->
<cfoutput query="session.page">
Page ID: #id#
Page Title: #ice_page#
Channel ID: #ice_channel_id#
Site ID: #ice_site_id#
Published File: #published_file#

Meta Title: #meta_title#
Meta Description: #meta_description#
Meta Keyword:  #meta_keyword#
Rank: #rank#
Link Text: #link_text#
Created: #created#
</cfoutput>
<!--- Selectively Display or Output Page Data --->

 

  • Retrieve all Pages belonging to a Channel in a specific language

<!--- Retrieve all Pages belonging to a Channel in a specific language --->
<cfmodule template="../../../widgets/page.cfm" channel_id="#url.cid#" site_language_id="#session.my_language_id#">
<!--- Retrieve all Pages belonging to a Channel in a specific language --->

<!--- Dump the query results to see which variables are available --->
<cfdump var="#session.page#">
<!--- Dump the query results to see which variables are available --->

<!--- Selectively Display or Output Page Data --->
<cfoutput query="session.page">
Page ID: #id#
Page Title: #ice_page#
Channel ID: #ice_channel_id#
Site ID: #ice_site_id#
Published File: #published_file#
Meta Title: #meta_title#
Meta Description: #meta_description#
Meta Keyword:  #meta_keyword#
Rank: #rank#
Link Text: #link_text#
Created: #created#
</cfoutput>
<!--- Selectively Display or Output Page Data --->

 

Note: As is evident from the examples above, the Content Widgets give you all the flexibility you need to retrieve and display dynamic content with just a few lines of code. You can use built-in variables to automatically retrieve the right content or you can handcode variables such as site_id, channel_id, site_language_id and page_id to retrieve specific pieces of content. You can even use the widgets to selectively retrieve content from other sites managed by I.C.E.


2. Querying the I.C.E. database directly

Experienced Coldfusion Developers can use <cfquery> to query the I.C.E. database tables dynamically for an additional level of flexibility.

 <cfquery name="GetPages" datasource="[ICE DATASOURCE]">
SELECT * FROM ice_page WHERE ice_channel_id = 1 AND ice_status_id = 1 ORDER BY Rank DESC
</cfquery>

<cfoutput query="GetPages">
Page ID: #id#
Page Title: #ice_page#
Channel ID: #ice_channel_id#
Site ID: #ice_site_id#
Published File: #published_file#
Meta Title: #meta_title#
Meta Description: #meta_description#
Meta Keyword:  #meta_keyword#
Rank: #rank#
Link Text: #link_text#
Created: #created#

</cfoutput>

 

After you have added your Index Template Code and Template Code, enter a Rank, which determins the order in which Channels are listed in ascending order, specify whether this Channel is a Sub-Channel of another Channel, select a language if it's a multi-lingual site and set the Status to Active. Then click the Save button to save the Channel.

Note: Only Administrators can create and modify channels.

 



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!