Skip to main content
Inspiring
August 1, 2006
Question

Pages don't always show when using cfinclude

  • August 1, 2006
  • 2 replies
  • 330 views
For our site we have a page template, a shell, that we use to display pages. It uses a cfinclude to call the page into the template:

<cfinclude page=#url.PageName#.cfm>

The link for that page would look like:

<a href="index.cfm?PageName=contact">

However, on a number of occassions, users click a link for a page, and get the error "page not found". If they simply hit refresh, the page shows up without a problem. The page is there, and it works, but it just doesn't always show until refreshed. Of course, most users don't know to refresh, and it's a pain to do anyway.

Any ideas why this happens? Suggested solutions?

Thanks,
Tim
    This topic has been closed for replies.

    2 replies

    Participant
    August 2, 2006
    Perhaps you could try using a relative path rather than just the filename of the page.
    Like <cfinclude page="/whatever/index.cfm"> or <cfinclude page="/index.cfm"> when it's in your rootdirectory.
    CF sometimes seems to mix up the paths.
    August 2, 2006
    i use cfinclude constantly with no problem... when you get the 404 page, right click, go to properties and see what page is being called.

    i doubt this would be an issue but try dropping the "url." from variable... (never know). i usually misspell things like "PageName" for the same reason (never know) so would be pgName or something. i never use common words unless i have to in variables and db fields.

    love CF but it has got tons of weird bugs that you just have to work around.

    hope this helps....