Re: Multiple body tags result in multiple headers and footers
Marc Hodgins <[email protected]> Fri, 29 Jun 2007 14:18:21 -0600
| Newsgroups | gmane.comp.apache.mod-layout |
|---|---|
| Message-ID | <[email protected]> |
Hi Brian Thanks very much for the quick reply. I have spent a few hours digging through mod_layout to see if I can build a patch (C .. and especially C and APR are a lot more complicated to work with than PHP.... not sure if I'll be able to successfully submit a patch..). I guess my question is - shouldn't the AddOutputFilter directive only parse the output AFTER it has been processed by PHP? In my scenario, only one set of <body> tags are ultimately written to the client. The multiple body tags simply exist in the PHP source code file(s). Is there any way to force the order of AddOutputFilter so mod_layout only sees the final output? Or, am I way off base here as to the source of the problem? Thanks again, Marc [email protected] wrote: > Send Mod_layout mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.tangent.org/mailman/listinfo/mod_layout > or, via email, send a message with subject or body 'help' to > [email protected] > > You can reach the person managing the list at > [email protected] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Mod_layout digest..." > > > Today's Topics: > > 1. Multiple body tags result in multiple headers and footers > (Marc Hodgins) > 2. Re: Multiple body tags result in multiple headers and footers > (Brian Aker) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 28 Jun 2007 21:48:37 -0600 > From: Marc Hodgins <[email protected]> > Subject: [Mod_layout] Multiple body tags result in multiple headers > and footers > To: [email protected] > Message-ID: <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi there, > > I'm attempting to implement mod_layout on a machine running apache2 and > mod_layout 4.1, using the following directives: > > AddOutputFilter LAYOUT php > ScriptAlias /share/ "/usr/share/php/" > LayoutHeader /share/mod_layout/header.php > LayoutFooter /share/mod_layout/footer.php > > The trouble is, on some pages, there are multiple <body></body> tags > within the code.. the multiple body tags aren't all written to the final > output, but they're included in the PHP code. These are third party > applications deployed on hundreds of sites that we host, so I cannot > change them. A simple example: > > <?php > if ($_GET['s']=='home') { > echo <<<EOT > <body>home page</body> > EOT; > } else { > echo <<<EOT > <body>another page</body> > EOT; > } > ?> > > mod_layout sees each <body> tag and inserts multiple headers and footers.... > > Have I implemented mod_layout incorrectly? Internally, shouldn't > mod_layout catch only the first and last <body> tag? Is there any way I > can work around this? > > Thanks, > Marc > > > > > > > > > > > ------------------------------ > > Message: 2 > Date: Thu, 28 Jun 2007 21:58:46 -0700 > From: Brian Aker <[email protected]> > Subject: Re: [Mod_layout] Multiple body tags result in multiple > headers and footers > To: [email protected] > Cc: [email protected] > Message-ID: <[email protected]> > Content-Type: text/plain; charset="us-ascii" > > Hi! > > On Jun 28, 2007, at 8:48 PM, Marc Hodgins wrote: > > >> Have I implemented mod_layout incorrectly? Internally, shouldn't >> mod_layout catch only the first and last <body> tag? Is there any >> way I >> can work around this? >> > > Unfortunately it doesn't know anything about tag replacement except > that is should replace... Doing the first tag would be easy, and it > would be possible to do the last tag as well. I don't have time to > work on this at the moment but would accept a patch for it (and from > other comments in the mailing list, I don't think you are the only > person hitting this issue). > > Cheers, > -Brian > > -- > _______________________________________________________ > Brian "Krow" Aker, brian at tangent.org > Seattle, Washington > http://krow.net/ > http://tangent.org/ > _______________________________________________________ > You can't grep a dead tree. > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://lists.tangent.org/pipermail/mod_layout/attachments/20070628/7a095ab7/attachment-0001.html > > ------------------------------ > > _______________________________________________ > Mod_layout mailing list > [email protected] > http://lists.tangent.org/mailman/listinfo/mod_layout > > > End of Mod_layout Digest, Vol 16, Issue 6 > ***************************************** > > > _______________________________________________ Mod_layout mailing list [email protected] http://lists.tangent.org/mailman/listinfo/mod_layout