Support for OnSugar

Advanced Theme Tip: User Customization

Wed, 06/18/2008 - 11:06AM by sabs 13 Comments - 3,197 Views

For those of you that are interested in going above and beyond regular CSS when you create an OnSugar theme, here are some fancier options.

User Customization

Adding user customization to your theme gives users to ability to change the default attributes of your theme, like fonts, colors, etc.  The default OnSugar theme, for example, is fully customizable. 

To add user customization to your theme, either create a new theme, or click edit on the theme you’re currently building.  In the Info tab, click “Make this theme customizable.” This will pop-open a window where you will define those attributes you’d like to be customizable, also known as xml customizations.


What format should my customizations be in?
When the box pops open you need to make sure your xml looks like this:

<customization>
<attribute id="commenticon" selector=".postmetadata li.postcomments a" type="background" label="Date Bubble" value="image=url(http://media.onsugar.com/files/upl1/29/297176/24_2008/icon_comments.gif)"  width="17" height="14" uisection="Main"/>

<attribute id="link_color" selector="a, a:hover, a:visited, .header small" type="color" label="Links" value="#E93B91" uisection="Main"/>

<attribute id="header_text" selector=".header h1, .header h1 a:link, .header h1 a:visited, .header h1 a:hover, .header h1 a" type="font" label="Header Text" value="size=22px;face=Trebuchet;color=#ffffff;bold=true; italic=false" uisection="Header"/>

<attribute id="blog_title" selector="#header a" type="link" label="Site Title" value="face=Georgia;size=60px;color=#333333;visitedcolor=#333333;hovercolor=#333333; hoverunderline=true; visitedunderline=false" uisection="Main"/>

</customization>

Each attribute line controls a different color, font, etc. You can add as many as you need. The above code shows examples of the four main types.

What does each value in the attribute line control?

  • Id: Each line must have a unique id. This can be whatever you’d like, however you cannot have any spaces.
  • Selector: These are the css controls you are allowing folks to overwrite with customizations. You can put as many selectors into the field as necessary, be sure to separate each one with a comma. Note, you must not have any extra spaces in this field, else your customizations will not appear to work.
  • Type: These are different attributes you can change. You can choose from "color", "background-color", "border-color", "background", "font", and "link".
  • Label: This is what the user will see. You can only use alphanumberic characters and spaces (no %, & or -, etc.). Attributes do not need to have unique labels.
  • Value: Each type has a different set of values. These are the default ones for your theme.
    • Color, Background-Color, and Border-Color: The value is in a hex value, including the # sign. Example: value="#FF0000"
    • Background: The value is either a background image, or a hex value, including the # sign. Example: value="image=url(http://www.onsugar.com/image.gif)"
    • Font: The value for font is a semicolon-separated set of key value pairs. The order is not important, and all key values are optional. Read more about possible font values below.*
    • Link: This is how you change the link fonts, as well as colors for various hover states. Read more about possible link values below.
  • Width and Height: Optional, mostly used when setting a background image size. Omitting width and height will allow user to select any size image. Keeping them in will force them to use a similarly-proportioned image.
  • UiSecton: This is an optional field to help organize your attributes. If you want all Footer colors to go together you could use the syntax: uisection="Footer" - All attributes tagged with the same uisection will be grouped together.

 

What are the font value choices?
The value for fonts can be broken into the following parts, and need to be separated by a semicolon.

  • Size: Insert a size in px. The default is 12px
  • Face: Select from Arial, Arial Black, Comic Sans, Courier, Georgia, Lucida Console, Lucida Grande, Palatino, Tahoma, Times, Trebuchet, Verdana.  The
  • default is Arial.
  • Color: A css hex value, including # sign, or none (which means transparent)
  • Bold: Choose true or false, the default is false.
  • Italic: Choose true or false, the default is false.


Here is an example of font value: value="size=22px;face=Trebuchet;color=#ffffff;bold=true; italic=false"

What are the link value choices?
The value for links are the same as the above font link choices, but with several additional choices. They are:

  • Visitedcolor: A css hex value, including # sign, default is black.
  • Visitedunderline: Choose true or false, the default is false.
  • Hovercolor: A css hex value, including # sign, default is black.
  • Hoverunderline: Choose true or false, the default is false.


Here is an example of font value: value="face=Georgia;size=60px;color=#333333;visitedcolor=#333333;hovercolor=#333333; hoverunderline=true; visitedunderline=false"

How do I change the order the attributes appear in the customizer?
The fields always go Colors, Backgrounds, then Fonts. Then they display in the order they are written. To adjust the order inside each category, simply rearrange your attribute code.

Will these customizable variables override things marked !important?
No. Please note, if you have a css selector that has been marked !important in your css code, the customizations will not override the setting. To ensure your customizations work, make sure you remove the !important.

I am able to use the customizer, but the changes don't show up until I hit save. Why is that?
To ensure that you see your customizations as they happen, make sure that there are not any spaces in your values. For example if you have selector="a " - you will not be able to see the changes until you save. To fix the problem remove the extra space between the a and the ".

My background image isn't repeating, why is that?
To repeat controls are set in the actual css. If you would like the background to repeat, you will have to make sure that the position and repeat status are set to your liking on that end. It is not something the customizer can control.


1

can on sugar be private , can i make it private so tat others cannot see it ?

Wed, 09/02/2009 - 2:06am

2

i cant change the background? where should i copy the url image? can u show me the steps?

Sat, 09/05/2009 - 9:12pm

3

*sigh .
V confusing .

Fri, 09/11/2009 - 8:14pm

4

@xiaoqinn - right now they can't, but we're hoping to release that feature in the near future

@whimsicallife - each theme is different, for help please send more info (the theme you're using, your site, etc.) to help@onsugar.com

@fadzly - this post is intended for advanced theme builders who want to add in customizations to their theme

Sat, 09/12/2009 - 9:06am

5

Can I do letter spacings for my post title & blog title? If yes, what's the code for it? Thanks :>

Sat, 09/12/2009 - 11:30am

6

VCONFUSING . hahha , anyone how to do in a more simple manner ?

Sat, 09/26/2009 - 8:25am

7

i want make my own skin , but it seem so difficult )): anyone can teach me ?

Wed, 10/07/2009 - 11:12pm

8

OHH yeah am confused want to change background to my profile, dunno what to do? Does anyone know how?

Mon, 10/12/2009 - 7:43pm

9

How do I put songs in my blog?

Tue, 10/13/2009 - 7:31pm

10

can i add advertisements to onsugar?? if yes, how?

Tue, 10/13/2009 - 10:11pm

11

I am Using "OnSugar Theme - 3 Column"
I want to Change the Back Ground to the red vintage thing, How am i suppose to do it?
Please show me the step,
If you don''t get what i'm trying to say, PLease see my page, www.mckenze.onsugar.com.
Sent me the steps, Through email please,
mckenzeblurrb@hotmail.com
Thanks.

Fri, 10/30/2009 - 8:27am

12

@mckenze - the white background is controlled differently. however it looks like you're now using a different theme. one of your posts contains something that is breaking the theme. send an email to help@onsugar.com and we can try and get you sorted out.

Fri, 10/30/2009 - 10:54am

Post New Comment

If you are already an OnSugar member, or would like to receive email alerts as new comments are made, please login or register for OnSugar. Or connect with your Facebook account: .
The content of this field is kept private and will not be shown publicly.