Difference between revisions of "Style (CSS) and Eloquence (Languages)"

From EPrints Documentation
Jump to: navigation, search
(Adding a style sheet)
(Adding a style sheet)
Line 15: Line 15:
 
Try out some simple style rules to change the appearance of your EPrints template. If you aren't comfortable with CSS or your just feeling lazy you can copy my code from the box below.  
 
Try out some simple style rules to change the appearance of your EPrints template. If you aren't comfortable with CSS or your just feeling lazy you can copy my code from the box below.  
 
<pre>
 
<pre>
 +
.ep_tm_archivetitle {
 +
        display: block;
 +
        padding: 10px;
 +
        color: #D4FAE7;
 +
}
 +
 +
.ep_tm_menu, .ep_tm_header {
 +
        background: none repeat scroll 0 0 #525252;
 +
}
 +
 +
.ep_tm_logo {
 +
        display: none;
 +
}
 +
 +
.ep_tm_menu li {
 +
        padding: 20px;
 +
        display: inline-block;
 +
        border-top: 2px solid white;
 +
}
 +
 +
.ep_tm_searchbar {
 +
        background: none repeat scroll 0 0 #D4FAE7;
 +
        border-top: 1px solid #525252;
 +
        border-bottom: 1px solid #525252;
 +
}
 +
 +
.ep_tm_key_tools li a {
 +
        color:#525252;
 +
}
 +
 +
body {
 +
        margin: 0;
 +
}
  
 
</pre>
 
</pre>

Revision as of 18:53, 4 December 2010

EPrints has a rather complex hierachy of style sheets. You have eprints default styles which is then overwritten (where appropriate) by a local theme which is then overwritten in turn by your repositories local style sheets. Themes have been around since EPrints 3.0 but they are almost never used because very few people ever style more than one repository. Themes are a pack of style sheets, images, templates, static pages, and javascript which can completely change the look and feel of an EPrints repository. In EPrints 3.3 themes have been revisited and polished up so that they can be easily made into EPrints Bazaar packages.

In this tutorial we will focus on how to make your own theme which can be packaged for the EPrints Bazaar.

Creating the theme

You will need to start by creating your own theme directory. In this tutorial my theme name will be "abstract_flash" so the directory I will create for my theme is <eprints_root>/archives/<archive_name>/cfg/themes/abstract_flash/

Adding a style sheet

The first and easiest thing to do is create a new style sheet for our theme. In EPrints 3.2 the default template has been changed to make the things you can do with CSS styles much more powerful.

Create a stylesheet in your theme's directory: <eprints_root>/archives/<archive_name>/cfg/themes/abstract_flash/static/style/auto/y_abstract_flash.css

Try out some simple style rules to change the appearance of your EPrints template. If you aren't comfortable with CSS or your just feeling lazy you can copy my code from the box below.

.ep_tm_archivetitle {
        display: block;
        padding: 10px;
        color: #D4FAE7;
}

.ep_tm_menu, .ep_tm_header {
        background: none repeat scroll 0 0 #525252;
}

.ep_tm_logo {
        display: none;
}

.ep_tm_menu li {
        padding: 20px;
        display: inline-block;
        border-top: 2px solid white;
}

.ep_tm_searchbar {
        background: none repeat scroll 0 0 #D4FAE7;
        border-top: 1px solid #525252;
        border-bottom: 1px solid #525252;
}

.ep_tm_key_tools li a {
        color:#525252;
}

body {
        margin: 0;
}


which are stored in <eprints_root>/lib/static/style/auto