Building a Zen sub-theme: In shell commands

By Benjamin Melançon
on 28 Aug
2 comments

Key words and phrases

bash shell terminal command line make a Zen subtheme sub Zen theme for Drupal via command line

Tags

Description

From the Zen documentation How to build your own sub-theme (6.x), translated into bash commands. The project is called example, and we have installed the zen theme to sites/default/themes.

Someone enterprising could make this into a simple bash script.

cd /sites/example/www/sites/default/themes
sudo cp -pr zen/STARTERKIT/ example_zen
cd example_zen/
sudo mv STARTERKIT.info example_zen.info
sudo vi example_zen.info

All right, the editing of the .info file will be hard to script. But all the rest should definitely be scriptified.

We're still in /sites/scfabout/www/sites/default/themes/example_zen and the Zen system of themes is next door.

Because fixed-width layout is evil we go straight for flexible (or as it's called here, liquid). Urgh, maybe on this project I should be using fixed with. OK, make this a variable in the script! Alternate line is cp -p ../zen/zen/layout-fixed.css layout.css

sudo cp -p ../zen/zen/layout-liquid.css layout.css
sudo cp -p ../zen/zen/print.css print.css
sudo cp -p ../zen/zen/zen.css example_zen.css

Then the next steps of editing template.php and theme-settings.php to replace "STARTERKIT" with your theme name ("example_zen" in this case) could be scripted also.

 

Here's an experiment with getting the initial Zen from CVS

Using the latest in the Drupal-5 branch, with the idea that we'd be able to update it to a stable version later:


cd www/sites/default/
sudo mkdir themes
cd themes
sudo cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -r DRUPAL-5 -d zen contributions/themes/zen

Posted by Benjamin Melançon on Mon, 2008-09-15 17:54
What's this comment about Drupal 5 for?

Seems off-topic and points to a potentially dangerous mental instability on the part of the poster.

Posted by Benjamin Melançon on Thu, 2008-10-16 12:57
Post new comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <small> <pre> <strike> <sub> <sup> <kbd> <s>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.