开发者

Git & Web-design: handling multiple customized templates

I'm developing a CMS (with Django, but that doesn't matter) and have chosen GIT.

Installations will vary in:

  • Configs
  • Database contents
  • Media
  • Templates

First 3 are not a problem with git: we simply don't need these :)

While developing, I have 1 default template with related media. Later, each customer will receive his own design based on default templates (some slight customization).

I'm not going to support each of the custom templates as I introduce new features. Modularity helps with this but is not a 100% solution.

Do you have any experience to share?


Example: Currently, v0.1 rocks: it has one 'default' template and 10 customized: one per customer.

Now, in CMS v0.2 some new features has appeared: e.g. a login box. I tested it on the 'default' template, it works great & I'm proud of it :) Now, all 10 customers want to have that great innovative login-box. Do开发者_StackOverflow社区 I really have to update all that 10 customized templates manually?


The way I see it, you essentially have two options:

  1. Tell git to ignore the templates directory, and git clone the repository for each new customer, and then create the individual templates for each of them. The CMS reads in the one set of templates and renders the page.
  2. Each customer gets their own templates subdirectory, and you put the templates in there. Then, your CMS can load the relevant templates depending on the incoming URL or a config setting, or something else.

Now, as for which to choose, there are multiple aspects of this that you need to consider:

  • Are you going to give git access to your customers?
  • Are you going to have one single instance of the application for all of your customers (and not create one instance for each of your customers)?
  • Are you going to host the application(s) yourself (and not let the customer host their own)?

If the answer is yes to any of the questions, use the first option. You probably don't want customers to see/have access to your other customers' templates.

If the answer is no to all of then, then examine your own workflow and use whichever you think is going to be easiest to maintain. I'd probably pick the second option, as you'd only have to worry about one codebase when updating your app, as well as the added benefit of having version control on the templates.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜