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.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | drupal-xtemplate-blocks.patch | 1.76 KB | Kjartan |
| #5 | xtemplate-css-path-fix.patch | 1.68 KB | TDobes |
| #1 | xtemplate_patch.zip | 2.37 KB | robert castelo |
| xtemplate-patches.zip | 27.86 KB | robert castelo |
Comments
Comment #1
robert castelo commentedThis is xTemplate switch feature by itself, including default template (same as current xTemplate template).
Comment #2
dries commentedCommitted a modified version of this patch. Thanks.
Comment #3
TDobes commentedThis 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 referencingthemes/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.
Comment #4
robert castelo commented{filepath} perhaps?
Comment #5
TDobes commentedVery well... simple two-line patch attached to fix the problem by renaming {path} to {filepath}.
Comment #6
dries commentedI can't reproduce this problem?
Comment #7
Kjartan commentedYou 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.)
Comment #8
TDobes commentedIt appears that this has been fixed with version 1.55 of xtemplate.theme. (Dries renamed path to directory.) Can we close this issue? Kjartan?
Comment #9
dries commentedFixed in HEAD.
Comment #10
(not verified) commented