Can I Use <cfinclude> within a Dreamweaver Template?

I'm redeveloping my existing website, with the hopes of getting my users to help me keep the content of the site up to date through Macromedia Contribute.

I'm developing the site using Dreamweaver and Coldfusion and  I'm creating dreamweaver template pages for each division/department/user.  One thing that remains consistent on each of the pages is menu navigation, and I don't want my users to change this navigation on their individual pages.  If we go with templates, I very well could end up having over 50 different templates, because each department wants their own images.

I was hoping that I could create a seperate file with the just the header and footer information, and then have all my different templates call that through <cfinclude>, but it doesn't seem to be working, it isn't picking up the images that are in the header and footer files, so it looks like the path isn't working within the template.  

Is it possible to use <cfinclude> within the template pages.  I realize that templates act differently than include files, and I want the benefits of the templates by not allowing my users to change certain consistant features, but I also want to only have (1) menu that I can easily maintain throughout the entire site.

Any suggestions or help would be greatly appreciated.



kgarntoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongCommented:
Do you have a sample on how you include your template using <cfinclude> in your html pages?

regards
0
kgarntoAuthor Commented:
Thanks for your response, ryancys.

Below is the code that I currently have.  I've also tried several other variations with putting the header and footer files in The Templates directory or in the Includes directory, but still haven't been successful.  The header.htm actually has all the information for creating the beginning html as well as the styles and javascript, and then the footer page closes the html.

The actual template itself is located at:  http://www.hgtc.org/templates/resp_pages.dwt.cfm, and you can see as a template alone it looks fine and the header menu and footer shows up fine.

A page that is using the template is located at:  http://www.hgtc.org/main/EdSrvs/Instrc/AHealth/RespTherapy/index.cfm  This page was created from the template, but can't seem to find the header images

<!--- Header Template Goes Here --->
<cfinclude template="../includes/header.htm">
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" colspan="2"><img src="../images/resp_top.jpg" width="780" height="46"></td>
</tr>
<tr>
<td colspan="2"><img src="../images/resp1.jpg" width="192" height="57"><img src="../images/resp2.jpg" width="320" height="57"><img src="../images/resp3.jpg" width="268" height="57"></td>
</tr>
<tr>
<td colspan="2"><img src="../images/resp_bottom.jpg" width="780" height="105" border="0" usemap="#Map"></td>
</tr>
<tr>
<td colspan="2"><img src="../images/blank_temp3_13.jpg" width="780" height="22"></td>
</tr>
<tr>
<td colspan="2" align="left" valign="top"><table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="538" align="left" valign="top"><img src="../images/resp_therapy.jpg" width="538" height="30"><br>
<table width="538" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"><img src="../images/r1.jpg" width="538" height="13"></td>
</tr>
<tr>
<td width="18" background="../images/r_l.jpg">&nbsp;</td>
<td width="484" bgcolor="#cc5c5c"><!-- TemplateBeginEditable name="EditRegion1" -->EditRegion1<!-- TemplateEndEditable --></td>
<td width="36" background="../images/r_r.jpg">&nbsp;</td>
</tr>
<tr>
<td colspan="3"><img src="../images/r_2.jpg" width="538" height="15"></td>
</tr>
</table></td>
<td width="242" align="left" valign="top"><img src="../images/links.jpg" width="242" height="30"><br>
<table width="241" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"><img src="../images/l_1.jpg" width="242" height="13"></td>
</tr>
<tr>
<td width="29" background="../images/l_l.jpg">&nbsp;</td>
<td width="189" bgcolor="#cc5c5c"><!-- TemplateBeginEditable name="EditRegion2" -->EditRegion2<!-- TemplateEndEditable --></td>
<td width="24" background="../images/l_r.jpg">&nbsp;</td>
</tr>
<tr>
<td colspan="3"><img src="../images/l_2.jpg" width="242" height="14"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<!--- footer information goes here --->
<cfinclude template="../includes/footer.htm">
0
JoshPowellCommented:
Yes, there is no reason you couldn't use <cfinclude>, however most likely Dreamweaver wont recognize it as an include(), so it will just treat it as invalid syntax and/or a comment.

You said you are having problems with the image's path?

Try the <base> tag to set the root path thats used for all relative images/links... it goes like so:

<base href="http://www.yoursite.com/whatever">

Just set that to wherever your images are stored.

Josh
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Ryan ChongCommented:
your images' path is not mapped correctly.. for a quick solution is try put your image source as full path, like change:

<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('collprofile','','../images/m5_over.jpg',1)"><img src="../images/m5.jpg" alt="Click here to visit College Profile" name="collprofile" width="112" height="28" border="0"></a>

to:

<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('collprofile','','http://www.hgtc.org/images/m5_over.jpg',1)"><img src="http://www.hgtc.org/images/m5.jpg" alt="Click here to visit College Profile" name="collprofile" width="112" height="28" border="0"></a>

Hope this helps
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ryan ChongCommented:
JoshPowell's suggestion is nice, but be careful to use it if the pages are interact with other sites ;-)
0
JoshPowellCommented:
ryancys,
Thats correct about the image path :)

You don't have to use absolute paths though, change the ../ to a ./ and it should work fine.. I try to use reletive paths as much as possible, just in case I have to switch domains or something.


Josh
0
kgarntoAuthor Commented:
Thanks to both ryancys and Josh.  

Both methods worked for me.
0
JoshPowellCommented:
You're welcome.. always glad to assist :) Glad you got it worked out


Josh
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Dreamweaver

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.