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


Template based editing
 Moderated by: Keith  
 New Topic   Reply   Print 
AuthorPost
therac
Member
 

Joined: Thu Feb 23rd, 2006
Location:  
Posts: 7
 Posted: Sat Feb 25th, 2006 09:18 pm
 Quote  Reply 
I want to be able to use a common template for pages, and to allow the user to use "save as" to replicate a template based page.  If I create a page eg.shtml (using SSI):

<!--#include virtual="/template/header.inc" -->

<div id="MainContentContainer">
  <div id="MainContent" editblock="one">
    <p>Text block one</p>
  </div>
  <!-- editblock="one" -->
</div>

<div id="RightContainer" editblock="two">
  <p>Text block two </p>
</div>
<!-- editblock="two" -->

<!--#include virtual="/template/footer.inc" -->

It displays correctly, and I get two blocks to edit in the editor.  However when I save or save as, the editor reverts to the text before I edited - in effect it reloads the original page.

However if I use:

<!--#include virtual="/template/header.inc" -->

<span includeblock="/test.inc">
<!--#include virtual="/test.inc" -->
</span>

<!--#include virtual="/template/footer.inc" -->

with test.inc holding exactly the same data, the edit is saved in test.inc correctly.  However with this syntax I cannot use save as to replicate the page without affecting the original page as both use the same "test.inc" file.

Please, what am I doing wrong ?

header and footer don't contain any editblocks etc - just a div based layout with complete HTML (header starts with DOCTYPE etc.).  It would therefore be syntactically incorrect to wrap them in a SPAN or DIV....

Thanks

Keith
Moderator
 

Joined: Fri Apr 8th, 2005
Location:  
Posts: 578
 Posted: Sun Feb 26th, 2006 04:39 pm
 Quote  Reply 
I can see no problem with what you've posted and explained. The top scenario does save and saveas ok for me. Perhaps there is something in header.inc or footer.inc that is causing a problem. Plead post both of them.

therac
Member
 

Joined: Thu Feb 23rd, 2006
Location:  
Posts: 7
 Posted: Sun Feb 26th, 2006 05:10 pm
 Quote  Reply 
Happy to email them to you  (address?) - as yet not on live site, and probably too large to post on a forum.  I will in any case check the first scenario on a different site (currently implemented on Windows Apache install, so will try Linux in case something odd is happening). They are part of an accessible fluid design, so fairly complex.

therac
Member
 

Joined: Thu Feb 23rd, 2006
Location:  
Posts: 7
 Posted: Sun Feb 26th, 2006 06:10 pm
 Quote  Reply 
OK - have simplified it down and removed style sheet - still refuses to save the eg1.shtml file.

header.inc is now:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <title>
      a test
    </title>
    <meta http-equiv="Content-Type" content=
    "text/html; charset="iso-8859-1"">
    <meta name="description" content="">
    <meta name="keywords" content="">
  </head>
<body>
<div id="LeftContainer">
<ul>
<li><a title="What We Do" tabindex="5" href="/template.htm#">What We Do</a> </li>
<li><a title="Link To Another Page" tabindex="6" href="/template.htm#">Link To Another Page</a> </li>
<li><a title="Company Updates" tabindex="7" href="/template.htm#">Company Updates</a> </li>
<li><a title="Link To Another Page" tabindex="8" href="/template.htm#">Link To Another Page</a> </li>
<li><a title="Profile" tabindex="9" href="/template.htm#">Profile</a> </li>
<li><a title="Contact Us " tabindex="10" href="/contactus.html">Contact Us</a> </li></ul></div>


footer.inc is simply:


<div id="FooterContainer">This is the page footer </div>

</body>
</html>

The reference to the stylesheet is removed, hence the id's are not found... However displays, and shows edit box around text block one.  Press save, and the screen glitches and returns to the original unedited state.  Interestingly enough, if I have eg1.shtml open in an editor which recognises changes (pfe in this case), it tells me the file has changed - and indeed the timestamp has updated (and if a backup has been created, it also saves - however the backup and the (allegedly edited) file appear identical.....

 

Keith
Moderator
 

Joined: Fri Apr 8th, 2005
Location:  
Posts: 578
 Posted: Sun Feb 26th, 2006 07:25 pm
 Quote  Reply 
I have copied your

<!--#include virtual="/template/header.inc" -->

<div id="MainContentContainer">
  <div id="MainContent" editblock="one">
    <p>Text block one</p>
  </div>
  <!-- editblock="one" -->
</div>

<div id="RightContainer" editblock="two">
  <p>Text block two </p>
</div>
<!-- editblock="two" -->

<!--#include virtual="/template/footer.inc" -->


to a page and copied your header and footer syntax to appropriate inc files. The page loads correctly and edits made to the two editbocks get saved.

There does not appear to be any problem with the page or inc files syntax.

If on Unix try change permission on the page's file to 0666. If the page then saves edits you are not running suExec on the server and EditWrx can not run on the server. If on Windows give Write privileges to the entire domain through the IIS interface.

avansant
Member
 

Joined: Fri Feb 3rd, 2006
Location:  
Posts: 4
 Posted: Tue May 2nd, 2006 03:40 pm
 Quote  Reply 
Therac -I have the same problem. Did you ever get it resolved? If I take the content of my footer and put it in the actual page all saves just fine. If I have the include tag instead it won't save, even though it's pulling the same information in either case. Funny thing is it was working and then just apprarently stopped one day...

Keith
Moderator
 

Joined: Fri Apr 8th, 2005
Location:  
Posts: 578
 Posted: Tue May 2nd, 2006 05:57 pm
 Quote  Reply 
One thing that is important about editing pages that have header and footer includes - the open BODY tag and close BODY tags can not be in the included files, they must be in the page's file.

When EditWrx opens a page to write to it, it first identifies the body section of the file, then finds and writes changes within that section. If the <BODY and </BODY> tags are not in the file, EditWrx can not find and make the changes, even though it will still write to the file.

avansant
Member
 

Joined: Fri Feb 3rd, 2006
Location:  
Posts: 4
 Posted: Tue May 2nd, 2006 08:45 pm
 Quote  Reply 
Ah! That's it! Thank you!

 


 Current time is 05:10 pm




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