Skip to main content
Participant
March 20, 2008
Question

Creating an cfif to check if page is index

  • March 20, 2008
  • 2 replies
  • 389 views
I'll firstly admit I'm pretty new to Coldfusion and have some programming knowledge in general so please be specific with any help.

I'm using CFWebstore and looking to customize my homepage layout. So I'm needing an if statement in the dsp_page.cfm that will display the output code in a new layout if it is the homepage, but default to the standard output if any other page.

So if I'm thinking correctly I'll want a

If page = homepage or index
then run this custom layout code,

else
run original without custom layout


I've got it to read the else, since it passes by my IF statement, so I really don't know how to check to see if it is on the homepage or not.

Thank you for any help!
    This topic has been closed for replies.

    2 replies

    Astonished_protector15C3
    Participating Frequently
    March 24, 2008
    Hi

    You can use CGI.SCRIPT_NAME to achive this.
    Inspiring
    March 20, 2008
    Look at your cgi variables. There are a few that you can use to tell you what page you are running.

    Hopefully the code you posted is in the onRequestStart() function of your application.cfc.