1 of 1 found this page helpful

Styled Page Buttons

    Introduction

    This template provides basic, customizable css styled buttons (here matched to the deucebeta:lighty-blue skin - but adjust to suit your implementation!)

    History

    Version Date Author Description
    1.1 03/09/2009 neels Shiny new css styling for more buttonlike behaviour
    1.0 20/08/2009 neels First published template version

    How do I install it?

    1. Create a template, call it "Template:PageButton" (or rename as you desire).  You must have "unsafecontent" permission for this to work.
    2. Create a "Dekiscript" block on the template page (use the "Style" menu in the editor")
    3. Copy the code from the end of this page and paste it into the Dekiscript block.  To copy, click "expand source", then mouse over the top right corner of the source code, and click the "view source" button.  This will pop up a window with the source code.  Select all, then copy to clipboard.
    4. Make sure there isn't an extra blank paragraph after the Dekiscript block! Do this every time you edit!!!  Save.

    A quick note about the examples on this page

    For all the examples on this page, the code is shown before the working example.  The code is shown with the syntax extension, and looks like this:

    PageButton()

    This means that the actual code on the page should be enclosed in a Dekiscript block.  If you want to copy the code from this page, then use the same procedure as described in steps 2-4 above. 

    How do I use it?

    Arguments

    Name
    Type
    Default
    Description
    url url required enter the url you wish the button to go to here
    title str? url The text to show in the button for the link

    Examples

    Show a button

    For instance:

    PageButton('http://news.bbc.co.uk','BBC News')

    will produce the following:

    Styled_Button_example.png

    and when hovered

    Styled_Button_hover_example.png

    Template code
    <html>
    <head>
    <style type="text/css">"
    span#center
    {
    text-align:center;
    }
    
    ul#navlist
    {
    width: 308px;
    \width: 310px;
    w\idth: 308px;
    padding: 0px;
    border: 1px solid #808080;
    border-top: 0px;
    margin: 0px;
    font: bold 2em helvetica,verdana,arial,sans-serif;
    background: #808080;
    text-align:center;
    margin-left:auto;
    margin-right:auto;
    }
    
    ul#navlist li
    {
    list-style: none;
    margin: 0px;
    border: 0px;
    border-top: 1px solid #808080;
    }
    
    ul#navlist li a
    {
    display: block;
    width: 272px;
    \width: 308px;
    w\idth: 272px;
    padding: 4px 8px 4px 8px;
    border: 0px;
    border-left: 20px solid #ccc;
    background: #dbe2f2;
    text-decoration: none;
    text-align: left;
    }
    
    ul#navlist li a:link { color: #666677; }
    div#navcontainer li a:visited { color: #666677; }
    
    ul#navlist li a:hover
    {
    border-color: #ccc;
    color: #ffffff;
    background: #737373;
    }
    "</style>
    </head>
    <body>
      <span id="center">
        <div id="navcontainer">
          <ul id="navlist">
            var url = $0 ?? $uri ?? '';
            if(#url != 0) {
              var title = $1 ?? $title ?? url;
                <li id="active">  web.link(url, title);  
                </li>
              }
          </ul>
        </div>
      </span>
    </body>
    </html>

    Here is an example of a set of buttons on the main page of our intranet site to aid navigation. I used a table for layout (old-school I know!). I have also used a customized version of neilw 'Hide Page Elements' template to tidy up the appearance of the deucebeta:lighty-blue skin.

    Styled_Buttons_example.png

    Was this page helpful?
    Tag page

    Files 3

    FileVersionSizeModified 
    Viewing 2 of 2 comments: view all
    NOTE: the styling may not work properly on this site due how CSS is setup.
    Posted 08:03, 23 Aug 2009
    @neels please attach a screenshot of what the button looks like. this site uses a special CSS override that prevents others from appreciated your work. thanks!
    Posted 03:27, 6 Oct 2009
    Viewing 2 of 2 comments: view all
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by