Forum Moderators: coopster
<?php
$q = $_SERVER["QUERY_STRING"];
$code = '<body>
<p> </p>
<!-- TemplateBeginEditable name="text" -->
<p><a href="links/links.php?m=link23999">Outgoing Link 1</a></p>
<p><a href="links/links.php?m=link24999">Outgoing Link 2</a></p>
<p> </p>
<p> </p>
<p><a href="page1.html">Page 1</a></p>
<p><a href="page2.html">Page 2</a></p>
<p> </p>
<!-- TemplateEndEditable -->
</body>';
$code = str_replace('html">','html?' . $q . '">',$code);
$code = str_replace('999">','&myVariable=' . $q . '">',$code);
echo $code;
?>
</html> In this template, DreamWeaver is not recognizing edit regions.
Is it possible to mark certain lines to be read like they are outside of PHP so DreamWeaver treats them the same way (outside)?
In addition, if this continues with other unpredictable cases (parts of HTML being ignored because they are inside PHP script), we better drop out such way of using PHP. Would you consider such way of combining PHP and HTML dangerous from the perspective of having site or some pages broken at some point? I mean, the whole <body> of each page will be parsed as PHP which worked great in testing mode, but stopped immediately as soon as we tried to apply it to a template in DreamWeaver.
Thank you.
[us.php.net...]
Or, you'll just have to break in and out of php, something like this:
<?php $q = $_SERVER["QUERY_STRING"];?>
<body>
<p> </p>
<!-- TemplateBeginEditable name="text" -->
<p><a href="links/links.php?m=link23<?php echo '&myVariable=' . $q?>">Outgoing Link 1</a></p>
<p><a href="links/links.php?m=link24<?php echo '&myVariable=' . $q?>">Outgoing Link 2</a></p>
<p> </p>
<p> </p>
<p><a href="page1.html<?php echo '?' . $q?>">Page 1</a></p>
<p><a href="page2.html<?php echo '?' . $q?>">Page 2</a></p>
<p> </p>
<!-- TemplateEndEditable -->
</body>
</html>
William.
Unless someone here has had exactly the same issue (with DW, editables, and php/html specifically) we probably won't be able to answer.
(The answer's not going to be in the php manual, but might in the DreamWeaver one.)
Justin