July 2007


Today I added some more Views to the little set of already finished pages in my long-taking journey to replace all scaffolded pages with my own creations. I added a simple index page for the recipes that is showing a random recipe at the moment. It could need some more tweaking, as I’m getting all recipes from the database and only using 1 to display its contents… this should be moved into a specific query to the SQL database to avoid the creation of many PHP variables.

Another View that is already in the creation process is the index page for categories and a simple view/edit combination. This is very easy because a category entry has only two fields: ID and category. So it isn’t too hard to create a page. :-) I added a basic validation using CakePHPs mechanisms and it is working fine. The result page when saving the edit is just a flash message that you have to click to continue, but I try to add some more AJAX style with a fading message box later.

I think I can work on CR2.0 in the next days, so there will be more change to come! Check the CVS repository for code updates.

Today I added some little files to add first XML export support to the new, cakephp-based Crisoft Ricette 2.0 branch. It is a stupid little layout file and a very basic function in the recipes controller to display the recipe as a pure XML page. It is based on RecipeML, but not on the full specification yet. Maybe I can blow it up this evening to support the complete RecipeML schema, but I’d be happy to go with just the sections head, ingredients and description.

The split of single ingredients and description steps makes it neccessary to have a format convention on the input fields of ingredients and description: Only one ingredient on a single line, only one step of description on a single line, each terminated with \n. Maybe this could be solved via multiple input fields for the ingredients, with an AJAX-style + button to add a new ingredient. This would lead to an AJAX autocomplete on that inputfield on already entered ingredients. That leads to a new database table, holding all entered ingredients or just their names. This would lead to another table with amount and ingredient connections… that would lead to a major stuck in my progress. :-) I think I’d go with the format convention of \n terminated lines for now.

I’d even like to have the recipes export themselves to RSS so anyone can include them in a feed or another mashup application. We’ll see how this will end.

Additionally I added a few layout pages, so the default scaffolding look of CakePHP is no more. :-) I try to setup a basic theme again, like the silverish slick I did while working on the pre1.0 version of Crisoft Ricette. It will be fully styleable via CSS too, to allow all users to adopt it to their own websites.