Home arrow MySQL arrow Page 8 - Building a Simple ColdFusion Content Management System with MySQL

Site Map - MySQL

This tutorial lays out the basics for creating a content management system in ColdFusion and MySQL. The System leverages hierarchical data to automatically build breadcrumb lists, a side navigation menu, as well as a site map. The goal of this tutorial is to provide a framework upon which to build a content management system that is easy to customize and maintain, leaving the web author more time to create content than maintain code.

TABLE OF CONTENTS:
  1. Building a Simple ColdFusion Content Management System with MySQL
  2. Starting With MySQL
  3. The Page and how to Update/Modify and Delete
  4. Add/Modify Form
  5. Action
  6. Breadcrumb List
  7. Side Menu
  8. Site Map
By: Charles Kaufmann
Rating: starstarstarstarstar / 48
August 11, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Site maps are useful to show people your entire site at a glance so they can more easily find what they are looking for. Another added bonus of a site map is it helps search engines spider your site. Here is the code.

1   <cfquery name="sitemap" datasource="#variables.data#">
2    select *
3    From tblpages
4    Where status='A'
5    Order by hierarchy
6   </cfquery>
7    <cfoutput query="sitemap">
8    <cfloop from="2"
9  to="#listlen(menusub.hierarchy, "~")#"
10  index="i"> - </cfloop>
11  <a target="_self" href="page.cfm?id=#menusub.id#"
12   title="#title#">#title#</a>
13    : (#dateformat(updatedate, "M/D/YYYY")#)<br>
14 </cfoutput>

Start by creating a new page called Sitemap.cfm or whatever you want to call it. Place the above code on it. What this will give you is your entire web site laid out in a hierarchical format with the last date the page was updated. Lets walk through the code quickly. Most of it should look familiar, because it is a very stripped down version of the side menu. This one includes all of the parents and children. The query is performed on all the active records and CFOUTPUT on line 7. I am using the same CFLOOP to put the dashes before the links. Lines 11 through 13 put the page links and the revision date on the page. That is it. Very simple because you have already done all the work on the add a new page action (populated the hierarchy variable).

Conclusion

We have walked through the creation of a simple but powerful content management system. We have leveraged the power of building the pages with a hierarchical structure which allows us to dynamically build out a breadcrumb list, a side menu and also a site map page. This was done to minimize the amount of time it takes to maintain and update a web site. This was not meant to be an extensive build out of a content management system, but to provide you with the core of what is needed. In order to put this on a public server, you still have to provide a way to authenticate the administrator so that you can lock all of the administrative functions from the public.



 
 
>>> More MySQL Articles          >>> More By Charles Kaufmann
 

blog comments powered by Disqus
   

MYSQL ARTICLES

- Xeround Releases Free Version of MySQL Cloud...
- Oracle Announces New MySQL Specialization
- Constant Contact Chooses SkySQL for MySQL Su...
- Revoke Statement in MySQL
- The Grant Statement in MySQL
- SuccessBricks Announces ClearDB Availability...
- Building a PHP ORM: Deploying a Blog
- TROSYS Launches Free MySQL Manager and Admin...
- Building an ORM in PHP: Domain Modeling
- Building an ORM in PHP
- MySQL Leads Open Source Market, Gets Cluster...
- Oracle Announces Milestone Release for MySQL
- How to Stop SQL Injection Attacks
- New Defragmentation Solution for SQL Server
- Comparison of MyISAM and InnoDB MySQL Databa...


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 9 - Follow our Sitemap

Dev Shed Tutorial Topics: