Welcome to WebmasterWorld Guest from 54.163.100.58

Forum Moderators: open

To CMS or Not to CMS?

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

5+ Year Member



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)

WebmasterWorld Senior Member 10+ Year Member



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.

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

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

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

5+ Year Member



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)

WebmasterWorld Senior Member 10+ Year Member



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)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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 -->

ASP
<!--#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:

index.html
main-update/my-rectangle.txt

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)

5+ Year Member



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)

5+ Year Member



I found the answer, which is to use the target attribute on the link, or set the base target on the document:
[stackoverflow.com...]
2:39 am on Dec 16, 2011 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



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.
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month