View Full Version : How to implement a CMS into a pre-designed site?

Mar 7th, 2009, 05:31 AM
I've been trying to figure out how to use a CMS. Is it possible to implement a CMS System into a website I built in XHTML/CSS? I went to opensourceCMS.com and did some demos, but they all run off a default template. How would I add my own code and then get the CMS implemented on top of that code?


Mar 7th, 2009, 06:07 AM
Hi aejacks8,

Its not easy to explain how to do this, but I will give it my best shot.

If you look at the default template (the source files) you will see PHP includes, usually on most CMS's this is what they use, say, a sidebar menu shows "Categories" and the categories listed, you might see this:

<?php include('modules/categories_horizontal.php'); ?>

you could insert that into your index.php file (just rename your .html file to .php so your server can read the PHP tags) where you would want the sidebar
"Categories" to show up.

It would go on with "title", "content", "footer", "copyright" and you would use PHP includes to include what you wanted, where you wanted it.

I don't know if I explained this in an understandable fashion, or if the CMS you are using even uses PHP includes, (which I am almost positive it does).

Depending on your CSS file, and the PHP files, you may have to either modify the PHP file, or the CSS, for example:

Say the PHP file has the "categories" menu not as a list, such as

<br />
<br />
About Us
<br />
Contact Us

but you had your css on your side bar coded as an unordered list,

<li>About Us</li>
<li>Contact Us</li>

You would either have to modify your CSS code, or do what I would do, and modify the PHP include file to output how you would want it to. You don't need to know alot about PHP to edit the output information, I know very little about PHP (but am in the process of teaching myself), but a quick lesson from w3schools.com on PHP should get you through.

I hope that any of this made sense, or even helped.


Mar 7th, 2009, 06:32 AM
Thats what I thought it would be. I'm not using any right now, but I want to use Joomla!. I understand the idea of Includes, but what is in each section? For example, how do I setup the sidebar or title or content? Is it just plain text that can be inputted/edited on the admin side?


Mar 7th, 2009, 06:49 AM
The includes, do you mean how do you control the content that is shown? Or, how do you control how the content is show.

Mar 8th, 2009, 12:30 AM
Both actually. I'm interested in how or what to add to my code to align it with the CMS. Maybe I'm looking for the wrong thing...

I basically want to be able to edit the content of the page via a web-interface. Thats a CMS right?

Mar 8th, 2009, 09:08 PM
I know CMS Made Simple (http://cmsmadesimple.org/) very well and there you can create your own templates. Basic implementation is pretty simple (as the name implies):

You create a new template, copy your HTML into the textarea and then replace the HTML that marks up the content of your page (as opposed to header and/or footer) with the {content} tag.
You create a new stylesheet, paste your CSS in there and attach that stylesheet to the previously created template.
Then you create a new page and insert whatever content you like (i. e. copy and paste the content from the content section of your current HTML document), choosing that newly created template as page template.

This way you can create many pages using the same template, and you can format your content with TinyMCE or whatever editor you like.

Mar 11th, 2009, 08:19 PM
VIPStephan - Thanks a lot! I will definitely check that out. It sounds like it is exactly what I'm looking for. :):):)