At the end of part one, we had a working CMS. Well, at least it was saving files and they could be displayed to the public. In today’s article, we are going to further advance our CMS. We will cover the following items:
- fckEditor
- Revisions
I really enjoying writing code and I find that snippets just don’t always cut it for me. So in today’s article, I am going to describe the process of creating a CMS (Content Management System) with CakePHP.
This will be a two part article, in part one we will focus on getting the basics working. The basics will include ability to add, edit, and delete static content pages.
Part two will advance on our basis and allow us to create drafts and revert back to previous versions.
When I created my first personal CakePHP web site, this was something that had me quite frustrated. I struggled and struggled to figure out and understand how to do a simple “if I change this select box, how can I populate another one”.
I had previously done this a million times in other languages with a simple Javascript onchange() function that would do my AJAX and populate my other select box.
To solve this problem, I checked CakePHP’s web site and did not find anything useful. Don’t forget this was almost a year ago, I find the web site has come a long way now. Because I couldn’t find a could example, I did the next best thing, I dove write into the form helper and ajax helper. Shortly after, I found enough information to start my trial and error process.
Excellent, now we are getting some where. Now that we know this, let’s create our two select boxes and make our second one populate through AJAX. (more…)
If you are like me and are creating personal web sites, one of the best ways to gain traffic to your site is through SEO. I won’t go into detail here as I want to focus on how to setup a route in CakePHP, but having SEO friendly URLs will go a long way in helping.
First let’s define what a “route” is. In CakePHP it allows you to add a different path to access a specific controller and/or function in that controller.
For example, let’s say I want to create a CMS. I might create a controller called “StaticContent” and then place a function for each page a client would like to create. I’m pretty sure I would start getting a lot of calls saying, “Jamie, why is my URL http://www.myaddress.com/StaticContent/myCustomPage?” So to avoid those calls, we can use a route to make it more accessible and SEO friendly. (more…)
Hi folks, I have just finished creating my first CakePHP component and I wanted to share it with the community. After I finish writing this article, I will be submitting it to CakePHP for inclusion.
The component is called StringExtractComponent. As you may guess, it extracts content from a piece of content. I have created this component to mimic the STREXTRACT function in Microsoft Visual FoxPro. I have come to fall in love with this function because it makes retrieving data from a string with a start and end delimiter. I’ve also created two other examples with SQL substring between two characters SQL substring between two characters as well as a String Extract Extension Method with C#.
To help you understand how it is used, I read the contents of one of my articles into a string. I then proceed to extract a specific section that is contained within the code syntaxes that exist in the article and it is important to truncate a string.
(more…)