In my main page, I use <cfinclude> tag to include my header and footer.
But I get error. "Context validation error for the cfif tag.
The start tag must have a matching end tag. An explicit end tag can be provided by adding </cfif>. If the body of the tag is empty, you can use the shortcut <cfif .../>. "
If I put the three files into one big file without using <cfinclde> tag, the page display with no error.
Here is my code:
[CODE=cfm]<cfinclude template="copyr ights_header.cf m">
<!--- Start page content. --->
My Main Page
<!--- end page content --->
<cfinclude template="copyr ights_footer.cf m">
[/CODE]
My header code:
[CODE=cfm]<cfif isDefined("url. pageID")>
<cfset pageID=#url.pag eID#>
<cfelse>
<cfset pageID=0>
</cfif>
<cfif isDefined("url. secID")>
<cfset secID=#url.secI D#>
<cfelse>
<cfset secID=0>
</cfif>
<cfif isDefined("url. type")>
<cfset type="#type#">
<cfelse>
<cfset type="page">
</cfif>
<cfparam name="title" default="Copyri ghts">
<cfquery datasource="#ap plication.DBSou rce#" name="getTopLev els">
SELECT *
FROM tbl_page
ORDER BY display_order
</cfquery>
<cfif getTopLevels.Re cordCount GT 0>
<cfif pageID EQ 0>
<cfquery datasource="#ap plication.DBSou rce#" name="getTitles ">
SELECT * FROM tbl_page WHERE default_page ='Y'
</cfquery>
<cfelse>
<cfquery datasource="#ap plication.DBSou rce#" name="getTitles ">
SELECT * FROM tbl_page WHERE page_id = #pageID#
</cfquery>
</cfif>
<cfif getTitles.Recor dCount EQ 0>
<cfquery datasource="#ap plication.DBSou rce#" name="getTitles ">
SELECT * FROM tbl_page WHERE page_id = (Select min(page_id) FROM tbl_page)
</cfquery>
</cfif>
<cfif getTitles.Recor dCount GT 0>
<cfset pageTitle="Copy rights">
</cfif>
<cfinclude template="#appl ication.setting s.layout#/top_layout.cfm" >
<cfif isDefined("btnS ubmit")>
<cfif #pageID# EQ 0>
<cfquery name="getDefaul tTab" datasource="#ap plication.DBSou rce#">
SELECT page_id from tbl_page where default_page="Y "
</cfquery>
<cfset pageID=#getDefa ultTab.page_id# >
</cfif>
<cfquery name="feedBack" datasource="#ap plication.DBSou rce#">
INSERT INTO tbl_feedback
(page_id, rate, comments, section_id)
VALUES
(#pageID#, #form.rate#, '#form.comments #', #secID#)
</cfquery>
</cfif>
<!--- Get first level of Site Map = Page Title --->
<cfquery name="getPage" datasource="#ap plication.DBSou rce#">
SELECT page_id, page_name_en, sitemap_en, display_order
FROM tbl_page
Order By Display_Order
</cfquery>
<cfset msgMT = "This page is currently under construction">
<cfoutput>
<tr valign="top">
<td>
<table align="left" valign="top" border="0" width="100%" height="100%" cellpadding="0" cellspacing="0" >
<tr valign="top">
<td align="left" valign="top" width="20%" bgcolor="##F0F0 F0" rowspan="2">
<br>
<cfinclude template="#appl ication.setting s.layout#/expand_menu.cfm ">
</td>
<td valign="top">&n bsp;
<!--- <cfinclude template="#appl ication.setting s.layout#/inc_search_brea dcrumb.cfm"> --->
<span class="breadcru mb">You are here: <a href="../index.cfm">Home </a> > </span>
</td>
</tr>
<tr valign="top">
<td align="left" valign="top">
<table cellpadding="5" cellspacing="5" border="0" width="100%" height="100%" align="left">
<tr valign="top">
<td align="left" valign="top">
<cfif type is "search">
<cfinclude template="#appl ication.setting s.search#/searchLIB.cfm">
</td>
</tr>
<cfelse>
[/CODE]
My footer code:
[CODE=cfm] </td>
</tr>
</cfif>
<tr align="center" valign="bottom" >
<td>
<cfinclude template="#appl ication.setting s.layout#/inc_feedback_fo rm.cfm">
</cfoutput>
<tr valign="top">
<td><tr align="center" valign="bottom" >
<td>
<cfelse>
<B>The Site is currently under construction. Please visit us later. Thank you.</B>
</cfif>[/CODE]
But I get error. "Context validation error for the cfif tag.
The start tag must have a matching end tag. An explicit end tag can be provided by adding </cfif>. If the body of the tag is empty, you can use the shortcut <cfif .../>. "
If I put the three files into one big file without using <cfinclde> tag, the page display with no error.
Here is my code:
[CODE=cfm]<cfinclude template="copyr ights_header.cf m">
<!--- Start page content. --->
My Main Page
<!--- end page content --->
<cfinclude template="copyr ights_footer.cf m">
[/CODE]
My header code:
[CODE=cfm]<cfif isDefined("url. pageID")>
<cfset pageID=#url.pag eID#>
<cfelse>
<cfset pageID=0>
</cfif>
<cfif isDefined("url. secID")>
<cfset secID=#url.secI D#>
<cfelse>
<cfset secID=0>
</cfif>
<cfif isDefined("url. type")>
<cfset type="#type#">
<cfelse>
<cfset type="page">
</cfif>
<cfparam name="title" default="Copyri ghts">
<cfquery datasource="#ap plication.DBSou rce#" name="getTopLev els">
SELECT *
FROM tbl_page
ORDER BY display_order
</cfquery>
<cfif getTopLevels.Re cordCount GT 0>
<cfif pageID EQ 0>
<cfquery datasource="#ap plication.DBSou rce#" name="getTitles ">
SELECT * FROM tbl_page WHERE default_page ='Y'
</cfquery>
<cfelse>
<cfquery datasource="#ap plication.DBSou rce#" name="getTitles ">
SELECT * FROM tbl_page WHERE page_id = #pageID#
</cfquery>
</cfif>
<cfif getTitles.Recor dCount EQ 0>
<cfquery datasource="#ap plication.DBSou rce#" name="getTitles ">
SELECT * FROM tbl_page WHERE page_id = (Select min(page_id) FROM tbl_page)
</cfquery>
</cfif>
<cfif getTitles.Recor dCount GT 0>
<cfset pageTitle="Copy rights">
</cfif>
<cfinclude template="#appl ication.setting s.layout#/top_layout.cfm" >
<cfif isDefined("btnS ubmit")>
<cfif #pageID# EQ 0>
<cfquery name="getDefaul tTab" datasource="#ap plication.DBSou rce#">
SELECT page_id from tbl_page where default_page="Y "
</cfquery>
<cfset pageID=#getDefa ultTab.page_id# >
</cfif>
<cfquery name="feedBack" datasource="#ap plication.DBSou rce#">
INSERT INTO tbl_feedback
(page_id, rate, comments, section_id)
VALUES
(#pageID#, #form.rate#, '#form.comments #', #secID#)
</cfquery>
</cfif>
<!--- Get first level of Site Map = Page Title --->
<cfquery name="getPage" datasource="#ap plication.DBSou rce#">
SELECT page_id, page_name_en, sitemap_en, display_order
FROM tbl_page
Order By Display_Order
</cfquery>
<cfset msgMT = "This page is currently under construction">
<cfoutput>
<tr valign="top">
<td>
<table align="left" valign="top" border="0" width="100%" height="100%" cellpadding="0" cellspacing="0" >
<tr valign="top">
<td align="left" valign="top" width="20%" bgcolor="##F0F0 F0" rowspan="2">
<br>
<cfinclude template="#appl ication.setting s.layout#/expand_menu.cfm ">
</td>
<td valign="top">&n bsp;
<!--- <cfinclude template="#appl ication.setting s.layout#/inc_search_brea dcrumb.cfm"> --->
<span class="breadcru mb">You are here: <a href="../index.cfm">Home </a> > </span>
</td>
</tr>
<tr valign="top">
<td align="left" valign="top">
<table cellpadding="5" cellspacing="5" border="0" width="100%" height="100%" align="left">
<tr valign="top">
<td align="left" valign="top">
<cfif type is "search">
<cfinclude template="#appl ication.setting s.search#/searchLIB.cfm">
</td>
</tr>
<cfelse>
[/CODE]
My footer code:
[CODE=cfm] </td>
</tr>
</cfif>
<tr align="center" valign="bottom" >
<td>
<cfinclude template="#appl ication.setting s.layout#/inc_feedback_fo rm.cfm">
</cfoutput>
<tr valign="top">
<td><tr align="center" valign="bottom" >
<td>
<cfelse>
<B>The Site is currently under construction. Please visit us later. Thank you.</B>
</cfif>[/CODE]
Comment