Every now and then, you get that customer saying; You design the website but I want to add the content (like a blog) my self.
Well, no way I will provide the Sparkle templates and no way that I will add the content myself each time. That is to much of a headache.
But there is good news. With the embedded code box, you can have the customer adding content him self by the use of PHP!
I have a Sparkle page to add the content, to change or delete the content and to browse the content. When adding or changing content, the customer logs in with a password first.
Make sure you do not type the full php script in the embedded code box. That would be a maintenance nightmare! Keep the php scripts separate in files. All you put in the embedded code box is something like:<? Include “phpfilename.php”; ?>
For adding content (by the customer), create a Sparkle page with the functionality to submit a form, passing on a picture, title and text area. Then on submit, open an other Sparkle (thank you for adding) page, receiving the values. This page contains a php-include function of a php script to read the passed values (via $_REQUEST) and to store the values in a sql database.
To show the content, create a Sparkle page to show all the content (blog view), which holds the php file (include statement) to read the sql database and echo it as output. You can control the style with creating custom text style names In Sparkle and use these as classes in your php code (source code of the Sparkle page wil unveil the class names).
It is as easy as that and with this, Sparkle becomes better than Wordpress ever can be!
Have a good weekend,