Skip to main content
March 20, 2008
Answered

simple nav?

  • March 20, 2008
  • 7 replies
  • 701 views
I have a an easy problem that needs fixed, but for the life of me, I cna't find an answer...

1. Index.cfm - contains three areas: 1. Header, 2. left side navigation links, 3. main body section
2. I would like the links on the left to insert the respective content into the main body section.
3. The left side nav links are being called in using <cfinclude template="nav.cfm">, same type of thing for the header.
4. I though using <cf output>#pagename#</cfoutput> would be correct, but I'm not sure how to assign the name to the respective page...

Any ideas?

Much appreciated.
This topic has been closed for replies.
Correct answer Newsgroup_User
ok, maybe English is not your first language. let me re-phrase:

since you are on cf8, then use <cfdiv>s and ColdFusion.navigate() function.

hope this helps = hth


Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

7 replies

March 24, 2008
Actually.... it seems to be working without changing the <cfdiv> tag at all... can this be right? It seems to me that I should have to change that too, right?
March 24, 2008
Oguz... thanks, that was awesome. However... rather than all of the content being within dsp_content.cfm... is there a way to do this so that each link corresponds to each page respectively?

Ex.
About = about.cfm
Home = index.cfm
GenInfo = geninfo.cfm

Would I just change the link to something like this?
<a href="javascript:ColdFusion.navigate('home.cfm','mainContent');">Home</a>
<a href="javascript:ColdFusion.navigate('about.cfm','mainContent');">About</a>

How would I change this (below) to reflect the different URLs being used?
<cfdiv bind="url:dsp_content.cfm" id="mainContent" tagname="mainContent">

Thanks

Participating Frequently
March 24, 2008
You can point out any URL for the links. That would be one template which forwards your request, or any other templates.

The important part is the cfdiv tagname and your reference in the link for this object.
Newsgroup_UserCorrect answer
Inspiring
March 22, 2008
ok, maybe English is not your first language. let me re-phrase:

since you are on cf8, then use <cfdiv>s and ColdFusion.navigate() function.

hope this helps = hth


Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
March 21, 2008
then... hth?
Participating Frequently
March 21, 2008
Something like that?

index.cfm
<a href="javascript:ColdFusion.navigate('dsp_content.cfm?page=home','mainContent');">Home</a> |
<a href="javascript:ColdFusion.navigate('dsp_content.cfm?page=aboutus','mainContent');">About Us</a>
<br />
<cfdiv bind="url:dsp_content.cfm" id="mainContent" tagname="mainContent">


dsp_content.cfm
<cfparam name="page" default="Home">
<cfswitch expression="#page#">
<cfcase value="aboutus">
This is content for "About Us" page!
</cfcase>
<cfdefaultcase>
This is the home page.
</cfdefaultcase>
</cfswitch>

Is that what you want?
Inspiring
March 21, 2008
look into using <cfdiv>'s and ColdFusion.navigate() function then...

hth

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
March 21, 2008
To answer your questions... I'm using div tags, not frames....I'm using CF8...and I am trying to load content (other cfm files, not data from a database) into the main body part. I have a collapsable menu on the left that I wrote with js and am importing that in through a <cfinclude template> code. I'd like to be able to load fresh content in and keep the menu as is instead of resetting like it would if I used a template containing the menu.

Thanks!
Inspiring
March 21, 2008
do you want to load content into the main body part without reloading
the whole page?
does you page use frames to display different parts (header, left menu,
main body) or do you load them into DIVs?
which version of CF are you on? (important since cf8 has buit-in ajax ui
components you can use to change content of parts of page without
reloading whole page, and on prev versions you will have to use some js
framework)

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/