xTemplate is a theme which does an excellent job of seperating logic, structure and style - but has the major drawback that if a Web designer wants to use xTemplate to create a new template, they need to make a copy of xTemplate, then make quite a few changes to the PHP code before they can begin doing any kind of design work.

The attached patch makes it possible to create a new template for xTemplate by simply creating a sub-directoty in xTemplate containing an XHTML/HTML file and a CSS file. Designers can work on XHTML/HTML and CSS without needing to do any PHP coding.

This patch will make it easier to create, share, and install xTemplate templates.

Included with this patch is a demo xTemplate template called Pushbutton, which can be seen in use on the Pushbutton development site.

Comments

robert castelo’s picture

StatusFileSize
new2.37 KB

This is xTemplate switch feature by itself, including default template (same as current xTemplate template).

dries’s picture

Committed a modified version of this patch. Thanks.

TDobes’s picture

Category: feature » bug

This addition slightly broke the default xtemplate... It seems to be related to the path not getting correctly assigned in xtemplate.theme.

On both of my test systems, xtemplate.theme seems to reference /xtemplate.css, whereas it should be referencing themes/xtemplate/default/xtemplate.css... Looking at the code, the error that causes this is not immediately apparent.

It would appear that changing the name of the "path" element in the array to some other name (and making the appropriate change to the xtmpl file) result in the correct path being passed... I'm not sure why this is the case, but renaming {path} to something else seems to be a good idea.

robert castelo’s picture

{filepath} perhaps?

TDobes’s picture

Title: xTemplate Switchable Templates » XTemplate CSS link tag is incorrect
Assigned: Unassigned » TDobes
StatusFileSize
new1.68 KB

Very well... simple two-line patch attached to fix the problem by renaming {path} to {filepath}.

dries’s picture

I can't reproduce this problem?

Kjartan’s picture

Assigned: TDobes » Kjartan
StatusFileSize
new1.76 KB

You can see the problem on drupal.org when you navigate the book pages. This is do to blocks having a path element which replaces the path set further up in xtemplate_page(), it only does this when you have blocks on the left hand side. Here is a patch which fixes this, but we should do similar fixes for the other xtemplate sections we use. (That is xtemplate_node should prefix the xtemplate variables it sets with node. This is the best way to avoid future conflicts.)

TDobes’s picture

It appears that this has been fixed with version 1.55 of xtemplate.theme. (Dries renamed path to directory.) Can we close this issue? Kjartan?

dries’s picture

Fixed in HEAD.

Anonymous’s picture