Wiz CMS Tutorials

Make Some Simple Website Text Editable

Video Tutorial


Welcome to Wiz CMS! This should be the very first tutorial you take on how to use Wiz. Because of that I actually spend time explaining some of the fundamental concepts of how it works in this article. That makes this article way longer than is representative of the task you're completing (which is saying something...because it's still pretty short). However, if you read this article word for word (as opposed to skimming) it will give you a pretty decent understanding of some of the most basic operating principles of the CMS, and that basic knowledge will make learning each individual part of it go much easier! So if there's only one tutorial on here that you actually read, as opposed to skim, it should be this one.

Getting Started

When you open up the Wiz CMS download and go to the Wiz CMS itself you'll notice an index.php file and an EXTRA folder. That index.php file is the simplest (and will be the most commonly used) instance of the Wiz CMS. Every copy of that file that you put up in your website files will be an instance of the CMS. That simplest version of the CMS was designed to be self-contained in 1 file to make managing your Wiz CMS usage extremely easy. When you put it up you can put it in a folder (and leave it index.php so that going to the URL of that folder opens it) or give it your own filename, and you can put it pretty much anywhere on your site so that you control the URLs to edit content.

The Planning Stage

Obviously the first thing you're going to do is figure out what part of your website you want to make into editable text.

For tutorial example purposes we'll pretend that we have a site with a bit of HTML code in one of our pages that looks like this:

<h1>My Page Title!</h1>
<p>This is some neat text!</p>
<footer>that's all...</footer>

Then let's pretend we want to edit the text This is some neat text! within that. I just included the surrounding code to give you context of what's going on, so don't worry about that code. That text is all we're gonna edit.

After that, the last part of the "planning" stage is to just figure out where you want to edit it from (i.e. what URL the CMS should be at). In this case I want that to be http://mypretendsite.com/edit/

Step 1

The first step is to make a text file that holds the text to be edited. It doesn't technically have to be a .txt file (.html, .htm, etc. all works) it just needs to be a text based file. I do that by making a mytext.txt file (any name will do, just make it somewhat descriptive so you know what it is) and putting the text This is some neat text! inside of it. Then, since I want them to go to http://mypretendsite.com/edit/ to edit this, I make a folder named edit in the root of my site and put my text file in there.

Step 2

Now I'm going to put the PHP snippet in my HTML code to make it draw the text out of that text file rather than have it be hard coded into the HTML. That snippet can be found inside the EXTRA folder of your download in a text file named PASTE-IN-HTML-SNIPPET.txt. It's the line right at the top of that file. You need to take that snippet and replace the text you want edited with that snippet in your HTML code. Then just change the file path in that snippet to point to your new text file relative to your page. Once done it'll look something like this:

<h1>My Page Title!</h1>
<p><?php echo file_get_contents('edit/mytext.txt'); ?></p>
<footer>that's all...</footer>

And if you mess with the text in the text file and refresh your page, you'll find that your page says whatever that textfile says.

Step 3

Last but not least you need to grab the index.php file (the text editing CMS file) from your downloads (the one you see right next to the EXTRA folder) and put it in your edit folder alongside your text file. Then you need to edit it by finding the place where the $userName, $password, and $fileToEdit variables are (all right at the top). You need to make new username and passwords and also change that $fileToEdit variable to point to your text file (relative to the CMS file that you're currently editing). For our situation it should look something like this when done:

// CHANGE THESE! to the username and password that must
// be used in order to gain access to the site!!!
$userName = "newusername";
$password = "newpassword";

// change this to the file you want to edit relative to
// the cms's folder location
$fileToEdit = "mytext.txt";

That's it!

Now you're done. Just go to http://yoursitename.com/edit/ and as long as you know the username and password you can edit that bit of text!

If you want to see how easy it is to do this with rich HTML formatted text then go to the Wiz rich HTML text editing tutorial.

Tutorial Menu Next Tutorial ❯