You might have read my almost two year old article about custom bake templates.
Much changed since then. In Cake as well in my user-land code.

Note: The "setup" bake theme is written for 2.x but can easily be backported to 1.3 manually.

Outline

We probably all know how xxxxxxx powerful the Bake tool is. It is all about speed for the first outline of a project.
So the faster the first CRUD controllers are baked the sooner we can dig into the details.
But speed itself is not the only crucial part. If we have a model/table with a lot of meta fields that should not get baked we would have to remove them manually from index/view/form every time we re-bake. That’s not really something you want to waste your time with.

Skip Fields

With some custom template like mine you can skip certain fields for baking. Some like 'password', 'slug', 'lft', 'rght' are automatically skipped by my template. But you can also define additional fields yourself:

PS: Why not in the form itself? It is always better to put default values as a part of the logic into the controller and outside of the view layer.

Enum support

This article describes how to setup enums in CakePHP the easy way. Do this after you bake the model and BEFORE you bake controller and views. Then you will end up with ctps including all the Enum things automatically like a dropdown box for forms and translated values for index and view.

The Problem

The default templates of the "baking" process are not very useful for a productive environment.
They are meant to rapidly produce working code for development purposes. This is actually great for that matter. But as soon as you want to get your code online, you will face serious issues.
With CakePHP 1.3 you can now use your own templates – easier than ever before.
So why not customizing it first and saving a lot of time in the long run?

The Solution

In your /vendors/ folder (either globally in /root/vendors or locally in /root/app/vendors) create a new folder with your desired template name (e.g. "custom") inside "shells":/vendors/shells/custom
Tip: Copy all files from the cake default template (/cake/console/templates/default)
There should be 3 subfolders now:/custom/actions
/custom/classes
/custom/views

A quick guide

Views:

If you need access to field types, you may use $field in combination with $schema:

This way it will NOT display empty views (due to invalid ids).
autoRedirect() is optional – i have a controller method that decides whether to redirect to index or to referer (if available). Note: This function is not part of the core!

recursive should always be -1 by default (you could also define $recursive globally in app_model), and $order is the default order if none is specified.

Views (/custom/views/…)

Now the files with the most changes

The CakePHP Team some time ago changed to sprintf(__(‘Add %s’, true), __(x, true)) instead of __(‘Add x’, true) and then changed back due to incompatibilites with some languages (not sure which ones).
But in most cases the %s makes it easier to translate.
You only need the "action" names translated + singular and plural "Model" name.
Without it, you will need every possible pairing (cross product) – which can easily be 1000s of translations which is quite some overhead. and totally unnecessary.