Implementing a Content Management System
When implementing a CMS for the first time; it is important to understand how it dynamically serves up web pages. If this is not your first time implementing a CMS then the following article may also provide a welcome refresher on the fundamentals.
Static Website vs CMS
Unlike a static website which has seperate HTML files for each and every web page; a CMS instead serves web pages dynamically through a single index file. Using a server side scripting language such as PHP allows the CMS to retreive content stored on the server and then output dynamically generated HTML for the various web pages.
For visitors and search engines there is no discernable difference between a static and CMS powered website as the end result is still essentially a collection of URLs and HTML web pages viewable in the browser. However there are numerous advantages to using a CMS, not least of which is greater managabilty, and a controlled, easier content update process for general users with little or no web design experience.
One notable difference between a static website and a CMS powered website is the URL format. For example a URL on a static website will point directly to the corresponding HTML file and will usually include the file extension, whereas a page URL generated dynamically by a CMS will likely include a query string instead. Additionally a CMS can convert it’s dynamic URLs to friendly URLs to make links shorter and easier to read, catering to both visitors and search engines.
Example URL differences:
/contact.html (static page url) /?cat=123456789 (dynamic url) /contact/ (friendly url)
/blue-shoes.html (static page url) /?product=123456789 (dynamic url) /shop/footwear/blue-shoes/ (friendly url)
As shown in the examples friendly URLs provide nicer, easier to read URLs. Check out our friendly URL article if you would like to learn more on this.
Next we we look at the different ways XT-CMS can be implemented.
CMS Implemetation Methods
There are two main ways to implement XT-CMS:
Full implementation: use the CMS for all pages across the entire website.
Partial implementation: use the CMS for a particular section of the website, for example a blog or shop.
Deciding which implementation method to go with will depend on the website and the requirements of the website owner.
Usually it’s best to use the CMS for the entire website as all web pages can then be updated through the CMS. However when working with an existing website it might be more convenient and less disruptive to intially go with a partial implementation, this is especially true for websites with many pages that might take longer to transition over to a full implementation.
General recomendations on which implementation method to use:
- New website, bulding from scratch: Full implementation from the start.
- Existing website (small): Full implementation recommended, bring existing web pages into the CMS.
- Existing website (big): Partial implementation and optionally move to a full implementation over time.
Below we will explain both methods of imlpementation for XT-CMS. Note that no matter how the CMS is implemented the main index.php file that outputs the CMS front end must always point to scripts/cms_front.php and the CMS URL on the admin config page must always point to the URL of the main index.php file.
Fully implementing the CMS is recommended when building a new website or when full CMS functionality is required for an existing website.
When setting up the CMS you will need to ensure the main index.php file for the CMS is in the root directory of your website. This file will replace any existing home page file and the CMS can then be used to manage and update all pages on the website including the home page.
- Place the main index.php file from the root CMS directory into the root directory of your website
- Rename or delete any existing index.htm or index.html file in the website’s root directory (otherwise they will likely override the index.php file)
- Edit the main index.php file and ensure the relative path to scripts/cms_front.php is correct eg. “cms/scripts/cms_front.php” (the CMS folder can be renamed, but ensure it matches)
- In the CMS admin area go to the config page and set the CMS URL to your home page.
Partially implementing the CMS is recommended when you want to add blog or ecommerce functionality to an existing website without moving all existing web pages over to the CMS.
To use the CMS for only a section of your website simply rename the CMS folder and ensure that the CMS URL on the admin config page is pointing to it.
- Rename the CMS folder if desired eg. “blog” or “shop” etc.
- In the CMS admin area go to Settings -> Config and ensure the CMS URL corresponds to the CMS folder location.