Skip to main content
Inspiring
May 4, 2006
Question

PHP code not propogating to child pages

  • May 4, 2006
  • 4 replies
  • 597 views
Hi, I am struggling with getting a .dwt template to propogate php code changes to its child pages. I am aware that I must put <!-- Templateinfo codeOutsideHTMLIsLocked="true"--> in the HEAD and hav edone so but any changes just don't get copied to child pages.

Appreciate any help

Here is my page head

<?php
session_cache_limiter('none');
session_start();
ob_start();
?><?php require_once('../Connections/woodveneeruk.php'); ?>
<?php
mysql_select_db($database_woodveneeruk, $woodveneeruk);
$query_categories = "SELECT sectionID, sectionName FROM sections ORDER BY sectionName DSC";
$categories = mysql_query($query_categories, $woodveneeruk) or die(mysql_error());
$row_categories = mysql_fetch_assoc($categories);
$totalRows_categories = mysql_num_rows($categories);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<!-- Templateinfo codeOutsideHTMLIsLocked="true"-->
<!-- #BeginEditable "doctitle" -->
<title>Wood Veneer UK - supplier of exotic, burr and decorative veneer</title>
<!-- #EndEditable -->
<meta name="keywords" content="Vale Veneer, veneer supplier, veneer inlays, exotic veneer, burr veneer, decorative veneer, wood veneer, iron-on veneer, veneer offcuts, furniture manufacturers, restorers, marquetry, hobby, wood work, craft, maple, oak, mahogany, ash, walnut burr" />
<meta content="Veneer distributor supplier offering wood veneers, maple veneer, oak veneer, exotic veneer, burr veneer, veneers packs" name=description />

<link rel="stylesheet" type="text/css" href="../style.css"/>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a )&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a
.indexOf("#")!=0){ d.MM_p=new Image; d.MM_p[j++].src=a ;}}
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a
))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d)&&d.all) x=d.all; for (i=0;!x&&i<d.forms.length;i++) x=d.forms ;
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers
.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//-->
</script>
<!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
</head>
This topic has been closed for replies.

4 replies

Participating Frequently
May 12, 2006
Oh, i see...

When you create a template, you need to specify which part of the page be made into editable region.

If you want the content area to be editable, select that area, right-click and choose template > editable region.

Once finished, save the whole page as template. When you have a new page and apply a template to that page, the new page will have the same design layout as the template, and you can only modify the area that you made editable.

I hope I'll get it right this time.
bikeman01Author
Inspiring
May 15, 2006
johnycage, look mate thanks for trying to help but you're way off the mark here - I am not having a problem with editable regions. Please let someone else answer this.
Participating Frequently
May 11, 2006
Maybe your PHP code is outside the template...

The structure should look like this:

<Your_template_begins_here>
<?php
"this is php code"
?>
<Your_template_ends_here>

The whole PHP code is nested inside the template tags.
bikeman01Author
Inspiring
May 12, 2006
You lost me with that one, it is not necessary to have php code inside the template...

I'll explain again. Here is my .dwt content:

<?php
session_cache_limiter('none');
session_start();
ob_start();
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>

and here is the child page it creates:

<?php
session_cache_limiter('none');
session_start();
ob_start();
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Main.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>


As you can see the begin template and the codeOoutside bit has been added during the creation of the child page by Dreamweaver. I want to change it to codeouside=TRUE.

How can I do this if this part of the page is not editable?
or
How can I tell DW to create child pages with codeoutside=TRUE?

I have tried recreating the template and it's still doing this?
Is this a bug?

bikeman01Author
Inspiring
May 10, 2006
I don't think any of those are my problem. But I have notticed that when I create a page from my template the following is inserved:

<!-- InstanceBegin template="/Templates/Main.dwt.php" codeOutsideHTMLIsLocked="false" -->

So when I add <!-- Templateinfo codeOutsideHTMLIsLocked="true"--> to the head I think they must confilct.

Why is <!-- InstanceBegin template="/Templates/Main.dwt.php" codeOutsideHTMLIsLocked="false" --> being added to my child pages and how do i edit it?
Inspiring
May 4, 2006
What DW are you using?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"bikeman01" <webforumsuser@macromedia.com> wrote in message
news:e3cgvl$ce0$1@forums.macromedia.com...
> Hi, I am struggling with getting a .dwt template to propogate php code
> changes
> to its child pages. I am aware that I must put <!-- Templateinfo
> codeOutsideHTMLIsLocked="true"--> in the HEAD and hav edone so but any
> changes
> just don't get copied to child pages.
>
> Appreciate any help
>
> Here is my page head
>
> <?php
> session_cache_limiter('none');
> session_start();
> ob_start();
> ?><?php require_once('../Connections/woodveneeruk.php'); ?>
> <?php
> mysql_select_db($database_woodveneeruk, $woodveneeruk);
> $query_categories = "SELECT sectionID, sectionName FROM sections ORDER BY
> sectionName DSC";
> $categories = mysql_query($query_categories, $woodveneeruk) or
> die(mysql_error());
> $row_categories = mysql_fetch_assoc($categories);
> $totalRows_categories = mysql_num_rows($categories);
> ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns=" http://www.w3.org/1999/xhtml">
> <head>
> <!-- Templateinfo codeOutsideHTMLIsLocked="true"-->
> <!-- #BeginEditable "doctitle" -->
> <title>Wood Veneer UK - supplier of exotic, burr and decorative
> veneer</title>
> <!-- #EndEditable -->
> <meta name="keywords" content="Vale Veneer, veneer supplier, veneer
> inlays,
> exotic veneer, burr veneer, decorative veneer, wood veneer, iron-on
> veneer,
> veneer offcuts, furniture manufacturers, restorers, marquetry, hobby, wood
> work, craft, maple, oak, mahogany, ash, walnut burr" />
> <meta content="Veneer distributor supplier offering wood veneers, maple
> veneer, oak veneer, exotic veneer, burr veneer, veneers packs"
> name=description
> />
>
> <link rel="stylesheet" type="text/css" href="../style.css"/>
>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
>
> <script language="JavaScript" type="text/JavaScript">
> <!--
> function MM_swapImgRestore() { //v3.0
> var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++)
> x.src=x.oSrc;
> }
>
> function MM_preloadImages() { //v3.0
> var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
> var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
> i<a.length;
> i++)
> if (a.indexOf("#")!=0){ d.MM_p=new Image; d.MM_p.src=a;}}
> }
>
> function MM_swapImage() { //v3.0
> var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
> for(i=0;i<(a.length-2);i+=3)
> if ((x=MM_findObj(a))!=null){document.MM_sr=x; if(!x.oSrc)
> x.oSrc=x.src;
> x.src=a;}
> }
>
> function MM_findObj(n, d) { //v4.01
> var p,i,x; if(!d) d=document;
> if((p=n.indexOf("?"))>0&&parent.frames.length) {
> d=parent.frames.document; n=n.substring(0,p);}
> if(!(x=d)&&d.all) x=d.all; for (i=0;!x&&i<d.forms.length;i++) x=d.forms;
> for(i=0;!x&&d.layers&&i<d.layers.length;i++)
> x=MM_findObj(n,d.layers.document);
> if(!x && d.getElementById) x=d.getElementById(n); return x;
> }
> //-->
> </script>
> <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
> </head>
>


bikeman01Author
Inspiring
May 4, 2006
8