Web Design and Development Forums

cfinclude and defaulting...

This is a discussion on "cfinclude and defaulting..." within the Java, JSP, Cold Fusion section. This forum, and the thread "cfinclude and defaulting... are both part of the Program Your Website category.

Old Feb 21st, 2008, 08:09   #1 (permalink)
Junior Member
 
Join Date: Sep 2007
Location: Rosebud
Posts: 14
cfinclude and defaulting...

Hi. I am creating a website in coldfusion and i have a main page that has a cfinclude and includes whatever was passed on in the url.p

example..

say the adress was about.cfm?p=julie

then in the about.cfm, the cfinclude will include julie.cfm (i have .cfm after the #url.p#)

What i would like to know is how to i make it default to include a certain page if their is no parameter passed on (such as it might be about.cfm?p or it might just be a direct link to the page such as about.cfm)?

many thanks
lockmac is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Feb 21st, 2008, 11:31   #2 (permalink)
New Member
 
Join Date: Dec 2007
Location: India
Posts: 9
Re: cfinclude and defaulting...

tell me what u want exactly. (i have .cfm after the #url.p#).
uday is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Feb 21st, 2008, 21:48   #3 (permalink)
Junior Member
 
Join Date: Sep 2007
Location: Rosebud
Posts: 14
Re: cfinclude and defaulting...

Quote:
Originally Posted by uday View Post
tell me what u want exactly. (i have .cfm after the #url.p#).
what do you mean?

what i want is this.... if i go to resourc.cfm and dont have any variables attached, i want my cfinclude to include "main.cfm" but if i go to resource.cfm?p=sub, i want it to include sub.cfm.

i have it setup to include the argument that i sent through as a parameter but i just dont know how to do it so if their is no argument sent, that it will include a default page
lockmac is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Feb 22nd, 2008, 03:22   #4 (permalink)
New Member
 
Join Date: Dec 2007
Location: India
Posts: 9
Re: cfinclude and defaulting...

Hey mac it is very easy. Just check what is parameter value or either p is defined or not
for example-
<cfif isdefined("p") and p eq 'julie'>
<cfinclude template="required template.cfm">
<cfelse>
<cfinclude template="default template.cfm">
</cfif>

try it

best of luck

Last edited by uday; Feb 22nd, 2008 at 03:25.
uday is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Defaulting my stylesheet dudester123 CSS Forum 2 Sep 10th, 2006 20:45



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 23:06.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59