Skinning MT

skinningmt.png

After the dutchpink was released, I had an idea to skin Movable Type such that a user could easily switch between stylesheets. So after a lot of work with javascript, here is the package:

SkinningMT.zip SkinningMT.tar.gz

  1. Extract the contents of the distribution
  2. Upload the tmpl files in ASCII to the appropriate places (MTDIR/tmpl/cms)
  3. Upload mt-styleswitcher.php and the styles/ directory into your StaticWebPath (if none then your into your MT Directory, same location as mt.cgi)

The drop-down menu shows up on the main menu (screenshot) The only requirement is that your server runs PHP. The styles directory, its contents and mt-styleswitcher.php goes into your StaticWebPath. In mt-styleswitcher.php, change movalog.com to your domain name

<?php setcookie ('sitestyle', $set, time()+31536000, '/', 'movalog.com', '0'); header("Location: $HTTP_REFERER"); ?>

An explanation of everything, the styles directory contains the different stylesheet and their corresponding images. Style 1 is the default style and Style 2 is dutchpink style.

If you want to add a new style, you need to create a new directory (and number it appropriately) and upload the default images (those that come in the MT distributions). Next upload the skin's stylesheet and any special images -- make sure these special images overwrite the default ones!

Next add the that skin option. Find

<option value="<TMPL_VAR NAME=STATIC_URI>mt-styleswitcher.php?set=2">DutchPink</option>

and add right after it

<option value="<TMPL_VAR NAME=STATIC_URI>mt-styleswitcher.php?set=3">Name of Style</option>

There are some major changes I have introduced to make sure everything skins properly. The most major changes occur in list_blog.tmpl. These changes were introduced because the images were hardcoded into the template, take a look at the stylesheet to see some of these changes.

This may not work perfectly yet, but I will be making more updates as time goes on!

10 Comments

Mike Wills said:
on Nov 5, 2004 6:52 PM | Reply

In which file do you add additional skins? Also, you should clarify that the "mt-styleswitcher.php" and the styles directory go into mt-static. I now see it, but maybe make more empasis on it. Other that that, it looks good.

Arvind Satyanarayan said:
on Nov 5, 2004 6:59 PM | Reply

Emphasis added, I've included instructions above how to add a new skin. To add a new skin, create a new directory that is numbered as the next consecutive number. In that directory you add your styles.css, and upload the default images and any special images. Hope that makes sense

q1w2e20 said:
on Nov 13, 2004 5:56 AM | Reply

I try .but i get a message: php startup: unable to load dynamic library d:\php\ext\php_mysql.dll

so how to chang the directory? thanks!

Stevie Doig said:
on Apr 9, 2005 1:37 PM | Reply

Installed okay it seems, but missing a file from the downloaded zip: footer.tmpl

When I load mt.cgi, I get:

Loading template 'list_blog.tmpl' failed: HTML::Template->new() : Cannot open included file footer.tmpl : file not found. at extlib/HTML/Template.pm line 2024.

Do you have a copy of footer.tmpl ?

Thanks

Alex Sancho said:
on May 21, 2005 12:47 PM | Reply

Hi, i'm using MT 3.16 version and since i've implemented this hack, there's an strange issue, every time i try to save anything i got thie message "It looks like you've changed your password recently. Please log out and log in again to complete this action". Did you know anything about that problem? Thankx in advance

dafyd said:
on May 25, 2005 11:10 PM | Reply

Alex - I've just had the same problem, and a quick search on the MT support forum reveals this post. It seems that MT 3.16 has a new field ("magictoken")in the tmpl/CMS files, which must be present in the templates and set to the proper value. I'm guessing that Arvind's files are from an earlier release, that doesn't have the magictoken field.

I would have looked at fixing it, but I'm in the middle of exams at the moment and shouldn't be messing with MT...

I'll have a go in a couple of days, though - if you've not already found a fix, I'll let you know!

Arvind Satyanarayan said:
on May 25, 2005 11:30 PM | Reply

Add

<input type="hidden" name="magictoken" value="<TMPLVAR NAME=MAGIC_TOKEN>" />
just after the opening form tag

dafyd said:
on May 25, 2005 11:36 PM | Reply

As ever, Arvind, thank you! Absolutely fantastic.

Alex Sancho said:
on May 26, 2005 1:07 AM | Reply

Working again, thanks

konpxaed ypwbmfj said:
on Nov 9, 2008 7:37 AM | Reply

szbcydw pkqzwjlvf nymjhvitr qycbkumz jwzpqoi vchbwidqt axmgcvndi

Leave a comment

Preview