EditWrx Knowledge Base Home
 Search       Login   Register   Members   Help   Home 
Search by username


Body tags in include files
 Moderated by: Keith  
 New Topic   Reply   Print 
AuthorPost
Al
Member
 

Joined: Wed Mar 28th, 2007
Location:  
Posts: 1
 Posted: Wed Mar 28th, 2007 12:20 pm
 Quote  Reply 
My entire Web site uses two Includes on every page.  One for the Header and one for the Footer.  The <BODY> and </BODY> tags are within these include files.

This seems to be causing save to fail, when using Full Page Editing.  I think EditWrx doesn't see the body tags when they are in include files.

Is there anything I can do about this?

Keith
Moderator
 

Joined: Fri Apr 8th, 2005
Location:  
Posts: 583
 Posted: Wed Mar 28th, 2007 04:20 pm
 Quote  Reply 
When you are editing in Full Page mode you are editing what the browser calls document.body.outerHTML, that is, the content in the browser between the beginning of the open body tag and the end of the close body tag. When saving, EditWrx needs to use the same open body and close body tags in the file to anchor what to overwrite. The browser sends the document.body.outerHTML in the $edit_body variable and the regex is actually

$PAGE =~ s`(<body.+body>)`$edit_body`si;

There is no other way for the browser and the file to coordinate anchor points - considering that an include can start and stop in places that are not the beginning and end of a block level element that the browser can pick out of what it assumes is all in one file.

The easy way to edit such a file is to use an editblock. An editblock identifies a block level element in the page that the browser then sends instead of the body.outerHTML. EditWrx can then find that corresponding editblock in the file to overwrite.

The hard way is to chop existing includes into multiples so that the body tags are in the page's file instead of in the include file.


 Current time is 05:20 pm




Powered by WowBB 1.62 - Copyright © 2003-2004 Aycan Gulez