Vanilla 1 Documentation Archive

 
 
vanilla:styles
Table of Contents

Vanilla Styles

Styles in Vanilla are sets of cascading stylesheet & image files that are associated with specific themes.

Creating a New Style

Creating new styles for Vanilla is actually a very straightforward (though likely a time-consuming) procedure. The most difficult task ahead of you is deciding if you want to use the default Vanilla theme or if you want to try to create a style for a different theme.

Once you have chosen a theme for which you want to make a new style, navigate to the styles folder within the theme’s directory. There should be a “default” style in there, like so:

/path/to/vanilla/themes/theme_name/styles/default/

Create a copy of the default folder and rename it with your new style’s name. Now you will need to make it so that Vanilla uses your new style’s folder when it renders for you - this way you can see your changes take place as you make them. If you have the custom styles extension installed and enabled, you can do this quite easily by specifying the path to your new style in the custom style url in the Account tab on the “Change Style” form. It should be something like:

/vanilla/themes/theme_name/styles/my_new_style_name/

Applying Your New Style

The Automatic Way

Sign into Vanilla and go to the Settings tab. Click on the Themes & Styles link in the side panel. The second dropdown contains the styles you have available for the theme you are using. Select the new style and check the box to apply the style to all users. Click the save button and you’re done.

The Manual Way

Of course I recommend you try the automatic way (see above), but if you are a glutton for punishment, you can do it manually as follows.

First you must enable the style in Vanilla’s configuration. So, set it as the default style folder in your conf/settings.php file with the following line:

$Configuration['DEFAULT_STYLE'] = '/vanilla/themes/theme_name/styles/your_new_style/';

That line will make it so that non-signed-in users see your new style. If you have the custom styles extension enabled, you can add your new style to the styles list through the settings tab’s “Style Management” option. If you don’t have this extension enabled, and you want to make this new style the default for all users, read on.

To make signed-in users see your style. Add your style to the database with the following MySQL query:

INSERT INTO LUM_Style
(AuthUserID, Name, Url)
VALUES (1, 'Your style name', '/vanilla/themes/theme_name/styles/your_new_style/');

Now you need to assign everyone in your database to see that style. First find out what StyleID MySQL assigned to your style:

SELECT StyleID FROM LUM_Style
WHERE Url = '/vanilla/themes/theme_name/styles/your_new_style/';

Once you know what the StyleID is, update the user table with the following MySQL query:

UPDATE LUM_User SET StyleID = `your new StyleID`;

That’s it. Everyone should be seeing your new style now. If there are any issues, make sure that you have used the correct path names in all of the queries above.

Sharing your new Style

You can upload your new style to Lussumo so that other people can use it. Do so by following the Add-on Guidelines to prepare your style for being added to the Add-on Management application.

 
 
 
 
vanilla/styles.txt · Last modified: 2009/04/01 04:45 by dinoboff
Vanilla 1 Documentation archive (Wiki by DokuWiki)