Hi,
in order to create different themes on the basis of XTemplate, I copied the xtemplate directory to a new one and made the changes, I thought, needed. Then my troubles started. The "new" theme still collided with the old one and everything I changed produced another error.
Anybody here who has gone through this before and knows what to do? I like the XTemplate, and don't want to create a new theme.

Thank you in advance

Falko Hartmann

PS.: I don't need the special xtemplate options, if that simplifies the problem.

Comments

dabeeeenster’s picture

Hi there,

I have a similar problem. I have set up the xtemplate theme as I like. I now want to copy that theme and change the colours in the style sheet, so I can have xtemplate-blue and xtemplate-green (for example). When I change the folder name, from xtemplate to xtemplate-blue, and go through the 4 files in that folder updating the folder name, it breaks the entire site.

How do I go about renaming a style, so that I can have mutliple styles all based off xtemplate?

Ben

cel4145’s picture

for example, http://computersandwriting.org/ is a modified version of xtemplate. both the xtmpl and css files have been modified. but the theme is now called cw2004. here's how i did it:

1) renamed the folder to cw2004
2) did a search and replace on all four files in the folder, replacing XTemplate with CW2004
3) did a search and replace on all four files in the folder, replacing xtemplate with cw2004

see, xtemplate and XTemplate are both used, so case sensitive replacements seemed in order.

Black Knight’s picture

Thanks for the idea, but I already started to do my own theme by using the tutorial.
If there weren't so deeply hidden bugs in drupal, I would have already finished it.
setlocale-Problem is solved, now I am looking for solving the box problem, when using php code in there.
But thank you anyway.

Anonymous’s picture

Is one the 'bugs' perhaps that you are printing data in your PHP block rather than returning it as the documentation says?

Black Knight’s picture

Yes, that was it... Sorry, I tried so much, but I'm wether a php expert nor native English speaker. The documentation did not really help me, but your information was great. Works. Thank you very much!!

Eric Scouten’s picture

I've been doing some of my own themes (none are public yet -- stay tuned). I've found that I rarely need to change xtemplate code, but I often need to rewrite the xtemplate.xtmpl file, often substantially.

So I patched xtemplate.theme and added edit fields that allow you to specify two xtmpl files (an optional one for the opening page of a site, and another for all other pages).

If you want to hunt through the CVS contribs repository, you can find it under for_review/0128.HEAD.scouten.xtemplate_configuration.patch. This patch applies to the CVS version of about two weeks ago, and almost certainly will not work against 4.2.0. Unfortunately, it doesn't look like my patch will make it into the 4.3.0 release. :-(

bobdoyle’s picture

Cloning an xtemplate (or XTemplate).

Would you like a duplicate of xtemplate?

You may have a nicely working xtemplate, but need another one - for another drupal site using the same engine for example. Or you may want to switch your single drupal installation to change its look to match the season.

You need to copy the xtemplate folder, then search and replace xtemplate with yourtemplate in the new yourtemplate.theme file, and XTemplate with YourTemplate in the yourtemplate.theme and yourtemplate.inc files. Notice the case sensitivity (xtemplate <> XTemplate).

At this point, yourtemplate should show up in Home » administer » configuration » themes. If you enable it and switch to it, you will be disappointed. Configuration elements like Logo and Sidebar placement have been lost.

To get back your edited look, you will need to copy all the fields from Home » administer » configuration » themes » xTemplate and paste them into Home » administer » configuration » themes » yourtemplate.

At this point, you can make changes to yourtemplate, especially the yourtemplate.css file.
__________________________________

Here is a step-by-step how-to.

With file access to your site, navigate to the root/themes folder where the xtemplate folder is located.

#cp -R xtemplate yourtemplate (this makes a duplicate of the xtemplate files inside yourtemplate directory)
#cd yourtemplate
#ls - l (shows the four duplicate files)
#mv xtemplate.css yourtemplate.css (rename all the files)
#mv xtemplate.inc yourtemplate.inc
#mv xtemplate.theme yourtemplate.theme
#mv xtemplate.xtmpl yourtemplate.xtmpl

Check the user and group permissions, and chown them to match the other drupal and apache permissions needed.
#chown drupal:drupal yourtemplate.css (for example)

With a file editor (like jEdit), search and replace (in the yourtemplate folder), matching case:
xtemplate >> yourtemplate (or whatever).
XTemplate >> YourTemplate.

Back in drupal as admin, navigate to Home » administer » configuration » themes » xtemplate.
Open a new window and navigate to Home » administer » configuration » themes » xtemplate.

Copy the contents of Message on Front Page, Logo, etc from xtemplate window. Paste them into yourtemplate window. Match the Sidebar placement, Search settings, etc.

Now you should be able to switch back and forth between templates and see the same site.

You are ready to make changes in your clone of xtemplate.