<?xml version="1.0" encoding="windows-1252"?>
<node id="924344" title="Re: Adding content blocks to a static website" created="2011-09-06 05:42:00" updated="2011-09-06 05:42:00">
<type id="11">
note</type>
<author id="616540">
moritz</author>
<data>
<field name="doctext">
&lt;p&gt;Another approach is to use server side includes. Instead of a &lt;c&gt;&lt;!-- PLACE CONTENT BELOW --&gt;&lt;/c&gt; marker, you use &lt;c&gt;&lt;!--#include virtual="/your/newsfile.html" --&gt;&lt;/c&gt; and place all the new content in &lt;c&gt;$documentroot/your/newsfile.html&lt;/c&gt;. See [http://httpd.apache.org/docs/2.0/howto/ssi.html|the Apache SSI HowTo] for more information.

&lt;p&gt;That way the user just has to edit and upload one file.

&lt;p&gt;If you'd rather stick with the placeholder approach, I'd recommend to either not do an in-place edit (create a modfiied copy), or mark both the start and end of the edit section.

&lt;p&gt;For validation, [mod://HTML::StripScripts] has a pretty good reputation (though I haven't used it myself).

&lt;blockquote&gt;What else should I be aware of?&lt;/blockquote&gt;

&lt;p&gt;Security. As always.

&lt;p&gt;If you stick to the editing approach, you should be aware that it relies on uploading the whole HTML file. That means the user is able to replace it fully if he is malicious (maybe by extracting the server credentials from your script). It depends on your usage scenario if this is anactual problem.

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-616540"&gt;
[http://perl6.org/|Perl 6 - second systems done right]
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
924340</field>
<field name="parent_node">
924340</field>
</data>
</node>
