Log in

View Full Version : Need to create a simple 'update text on website' from a simple admin page



jamiemyburgh
07-01-2013, 10:31 AM
Hi there,

Have a simple html page which will display a restaurant's specials, each special consisting of an <h2> and a <p>, and they would like a very basic admin html page where they can update these specials in the list and also add or delete them. I need something really really basic, like input box, text area, click add special and it adds it - but not sure where to start, does anybody know how I could achieve this? The admin page doesn't even need to have a login - literally just ability to update specials dynamically.

My html page currently looks like this:


<div class="specials">
<ul>

<li>
<h2>20% Off all orders this Weekend</h2>
<p>Lorem Ipsum ist ein einfacher Demo-Text für die Print- und Schriftindustrie. Lorem Ipsum ist in der Industrie bereits der Standard Demo-Text seit
<br><br><br>
<a href="tel:0317653059" class="phone">click to call</a>
</p>
</li>

<li>
<h2>20% Off all orders this Weekend</h2>
<p>Lorem Ipsum ist ein einfacher Demo-Text für die Print- und Schriftindustrie. Lorem Ipsum ist in der Industrie bereits der Standard Demo-Text seit
<br><br><br>
<a href="tel:0317653059" class="phone">click to call</a>
</p>
</li>

<li>
<h2>20% Off all orders this Weekend</h2>
<p>Lorem Ipsum ist ein einfacher Demo-Text für die Print- und Schriftindustrie. Lorem Ipsum ist in der Industrie bereits der Standard Demo-Text seit
<br><br><br>
<a href="tel:0317653059" class="phone">click to call</a>
</p>
</li>

</ul>
</div>

Beverleyh
07-01-2013, 01:28 PM
does anybody know how I could achieve this?It depends on a few things - whether you know a server-side language (such as PHP), if your server is setup to run it, and if you have the time and knowledge to write a custom built script like this.

For something simple, you probably don't need to go for a full-blown database solution. Flat files should be fine.

If you are willing to overlook a custom build (where the end-user fills out a series of specifically labelled input fields to add an new entry, and then edits/deletes listings via a listing entry manager) you can probably get away with as pre-made script where a portion of the webpage is editable - rather like where you would edit a menu list in MS Word. Of course, this could potentially allow the end-user to completely fudge up your menu listing but that's part of the trade-off; Time, expertise and a custom-built script with very small error-margin Vs quick, ready-made, free alternative with potentially a bigger margin for error.

If that's a trade-off you're happy with, could you work with something like this? : http://fast-edit.co.uk/demo_besm/

Your server would need to run PHP and the page that the end-user is editing would need to be renamed with the .php extension. Another way is to use .htaccess to make the server parse HTML pages as PHP http://php.about.com/od/advancedphp/p/html_php.htm and then the page that it being edited could keep the .html extension (not ideal as it makes the server work harder, but it could be an option)

molendijk
07-01-2013, 02:49 PM
You could also give them this code:

<head>
<style type="text/css">
pre{
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
white-space: pre; /* CSS2 */
white-space: -moz-pre-wrap; /* Mozilla */
white-space: -hp-pre-wrap; /* HP printers */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: pre-wrap; /* CSS 2.1 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
li{margin-top: 0px; margin-bottom: 0px; font-size:150%; font-weight: bold}
div{margin-left:18px; margin-top:-20px;}
</style>
</head>

<body>

<pre style="font-family: verdana; font-size: 12px">


<li>20% Off all orders this Weekend</li>
<div>
Lorem Ipsum ist ein einfacher Demo-Text für die Print- und Schriftindustrie. Lorem Ipsum ist in der Industrie bereits der Standard Demo-Text seit
<!-- -->
click to call
</div>

<li>20% Off all orders this Weekend</li>
<div>
Lorem Ipsum ist ein einfacher Demo-Text für die Print- und Schriftindustrie. Lorem Ipsum ist in der Industrie bereits der Standard Demo-Text seit
<!-- -->
click to call
</div>

<li>20% Off all orders this Weekend</li>
<div>
Lorem Ipsum ist ein einfacher Demo-Text für die Print- und Schriftindustrie. Lorem Ipsum ist in der Industrie bereits der Standard Demo-Text seit
<!-- -->
click to call
</div>


</pre>
</body>
and then tell them that they are only allowed to change text between the li-tags and the div-tags (and that 'they get what they see').
So they can do it themselves.
If their text is supposed to belong to another page containing other info and maintained by yourself, you could insert their text using an iframe.