homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

To CMS or Not to CMS?

 4:18 pm on Dec 14, 2011 (gmt 0)

Hi, all. I'm working on a Website that requires the client to update a specific section (300w x 500h) of the home page. They're basically posting new data every week. I don't want to give them access to the home page file (index.html), as there's a risk that they can mess things up. Is there some sort of simple javascript (or other) code, or CMS that I can add that is isolated, and only lets the client to update that specific isolated rectangle box on the home page?



 4:27 pm on Dec 14, 2011 (gmt 0)

You could make a separate page for just the content and use an .asp or .php include to place it in your home page. I do it all the time and that way there's no javascripts involved. Of course, you index.html file has to be set to act like either an .asp or .php page.

<!--#include file="whatever.htm"--> or
<!--#include virtual="/wisdom.inc"-->

<?php include("whatever.htm"); ?>



 6:17 pm on Dec 14, 2011 (gmt 0)

Thanks but that I don't want to turn it into a PHP or ASP site. Is there any way to keep it html and just have them edit the small section remotely?


 9:18 pm on Dec 14, 2011 (gmt 0)

Yes, there are programs available that you can use which will allow users (with id and pw) to log in and change parts of pages that you have defined.


 4:59 pm on Dec 15, 2011 (gmt 0)

You don't have to change your site technology. You can do this via SSI's (Server Side Includes).

<!--#include file="whatever.htm"--> or
<!--#include virtual="/wisdom.inc"-->

Those directives originated from Apache's SSI's and are exactly the same in linux servers - except you need a space before -->

<!--#include file="whatever.htm" --> or
<!--#include virtual="/wisdom.inc" -->

You use file if the included file is in the same directory.

You use virtual if the file is in a directory. So in your scenario, you'd give your client access to only the "main-update" directory:


then in index.html, add

<!--#include virtual="main-update/my-rectangle.txt" -->

I posted full instructions here [webmasterworld.com] on how to enable SSI's for .html files.

All that being said - this is really only the beginning, if they want to modify one part they'll want to modify another. You might go ahead and bite the bullet and install some small scale CMS.


 6:28 pm on Dec 15, 2011 (gmt 0)

Thanks, I decided to go the iFrame route. Works brilliantly. Now there's just a small strip on the home page that the client can edit directly. Minor problem now is that links only open within the iFrame. How can they open into the browser instead (as if it was a normal link on the home page)? Or are we now only limited to opening links in a new window?


 9:23 pm on Dec 15, 2011 (gmt 0)

I found the answer, which is to use the target attribute on the link, or set the base target on the document:


 2:39 am on Dec 16, 2011 (gmt 0)

With the iframe route, the search engines are not likely to index the iframe content as part of the main page. Also as the main page content does not change it may be considered stale.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved