Re: Ryan wrote:Invoice templates

Joined: 08/07/2007
Juice: 15046

Thanks for stopping by and giving your input. Smiling

I think I'd stand by the theme layer for the invoice templates for two reasons...

  1. It makes practical sense, as you don't have to worry about accidentally deleting your custom templates when you update your Ubercart version.
  2. The theme layer in Drupal consists of two parts... templating the layout of elements and addressing the appearances. The former is done through .tpl.php files and the latter through your style.css. So, the modules expose the data, the .tpl.php will output the HTML, and the .css will add the appropriate styles for further positioning and presentation. Obviously the modules will define the components available to the invoice, but the .tpl.php will define how those components should be displayed on the page. This is normal in Drupal and is done for things like node displays. What Drupal 6 allows us to do is ship a .tpl.php file with a module that can be overridden by anyone in their theme with a .tpl.php file of the same name. So, we'll still be shipping invoice templates, but it will be a little easier for folks to modify and maintain their own invoice templates. The alternatives are either to keep it like it is w/ custom files in a module directory that may accidentally be deleted on update, only allow invoices to be defined in custom modules which makes it significantly harder for folks to adjust, or force people to hack core.
Ubercart Development Roadmap By: Ryan (33 replies) Wed, 06/11/2008 - 15:25