
A coldfusion URL Variable is defined simply with this dotted code (URL + . + 'varname'):
URL.varname
Copy and paste this code inside the #main section in index.cfm file (see this post to examine the page structure):
<!-- If is defined URL variable 'aboutme' -->
<cfif isDefined('URL.aboutme')>
<!-- include page 'about me' -->
<cfinclude template="include/in-aboutme.cfm">
<!-- else if is defined URL variable 'interests' -->
<cfelseif isDefiend('URL.interests')>
<!-- include page 'interests' -->
<cfinclude template="include/in-interests.cfm">
<cfelse>
<!-- in all other cases include the home page -->
<cfinclude template="include/in-home.cfm">
</cfif>
<cfif isDefined('URL.aboutme')>
<!-- include page 'about me' -->
<cfinclude template="include/in-aboutme.cfm">
<!-- else if is defined URL variable 'interests' -->
<cfelseif isDefiend('URL.interests')>
<!-- include page 'interests' -->
<cfinclude template="include/in-interests.cfm">
<cfelse>
<!-- in all other cases include the home page -->
<cfinclude template="include/in-home.cfm">
</cfif>
The result is the same obtained with PHP in the previous post.
No comments:
Post a Comment