How do i duplicate a theme as way to learn how to theme??

is there an overrride mechanism or do i back up some DB fields and folders

Comments

bwv’s picture

You can create a folder in your /sites/all/themes directory, called, for example, theme1.

Copy the contents of the existing theme folder whose contents you wish to tweak to that newly created folder.

(You may need to copy the engines folder from /themes to /sites/all/themes as well.)

Now, when you go to your themes settings under site building, you should see your new theme1 there.

Go into that folder and experiment with changes to the template.php file and others.

You might want to take a look at this module as well:

http://drupal.org/project/atck

----------------------------------------------------------------------
http://www.bwv810.com
http://davidhertzberg.com

I am a writer, researcher and solo drupal freelancer.
Je peux communiquer en français. / Я могу общаться на русском языке.

vm’s picture

I believe you may also have to change the .info folder of the copied theme to reflect the copied theme name.

Jeff Burnz’s picture

Just to be clear...

You must change the name of the .info file to reflect the name of your new duplicate theme & ideally at least one item in the .info file, namely;

name = my new theme

You must change the function names in template.php that are prefixed with the theme name AND all calls to those functions (if any).

Look out for other "gotchas" such as themes using drupal_add_css or drupal_add_js etc etc that may use the theme name as a parameter.

If you're using a half decent text editor you can do most of this with search and replace in 2 seconds:)

I have built perhaps 20+ themes for Drupal 6 so far and run many duplicates during dev and never had to copy the engines folder over to sites/all/themes and in my experience is not necessary.

chasz’s picture

thanks all i give it a try LOl

chasz’s picture

If i want to do subthemes, all i have to do is copy and rename the *.info?

Tiquelou’s picture

To know how to handle .info files for subthemes, you need to know what .info files are, and what information they contain.

.info files basically contain information about a theme; like theme name, which version of Drupal it is built for, and other information. So, when creating a new subtheme, you have to essentially mention the following:

  • Name of the subtheme
  • Name of the parent theme
  • Major version of Drupal core the subtheme compatible with

For more details, you can check http://drupal.org/node/171205