PDA

View Full Version : DW 8 Template Problem


dareid5
12-05-2006, 12:55 AM
I have a site that uses two templates for all the pages. The first template is for all files located at the root. The second template is for all subdir files. Both templates include the same menu which is added as a PHP include. All the subdir files work fine. The files at the root wonít load in the images included in the menu, the paths seem to be all wrong. I have tried a variaty of changes with the quotes using <?php include("@@('include.inc')@@"); ?> format etc.
Does anyone have an idea why Dreamweaver wonít update the paths or have a work around.
Thanks,
Dave

chriskq
12-05-2006, 01:26 AM
its prolly becoz like u sed 'the path is wrong'

if u have pages that are in a subfolder (ie, not in the root) you will need to add a ../

this means, go back a folder

eg, say if your homepage calls the php include
<?php include("common/controls/navigation.php");?>

on a page in the sub foler, it will need to be called like:
<?php include("../common/controls/navigation.php");?>

give that a go

dareid5
12-05-2006, 12:21 PM
chriskq,

I have tried that too... what seems to happen is when you apply the template the embedded include file doesn't get update as to its location. So that files at the root include the '../' and then force the include to go above the root. Is Dreamweaver smart enough to modifiy files that are included in a template file?

Thanks

domedia
12-05-2006, 01:33 PM
If you use templates, there's no need for any includes. Or am I missing something here?

The syntax for this is right, did you try chaning the path?
<?php include("@@('include.inc')@@"); ?>

dareid5
12-05-2006, 05:39 PM
This site has a large number of pages. I wanted to use includes to minimize the update time for the pages - both updating and uploading the pages takes for ever and has a higher chance of failure. Also I wanted to have these sections seperated so that when changing them i can see the code better.

Thanks,

domedia
12-05-2006, 05:54 PM
If the above code does not work with changing the path you might want to look into library items in DW, should be almost the same thing.