Stanford Modern Drupal Theme

From Web Services Wiki

Revision as of 09:41, 1 May 2012 by Hyperboy (Talk | contribs)
Jump to: navigation, search

Contents

Installation

Download the latest Stanford Modern Drupal Theme package. 

The themes for different Drupal versions are not interchangeable. The Stanford Modern Drupal Theme is intended for Drupal versions 6 only; it will not work with Drupal 5 or below.

Note: The Drupal 7 theme is coming soon. Subscribe to drupallers@lists.stanford.edu for the latest updates.

  1. Read any README or INSTALL files in the package to find out if there are any special steps needed for this theme.
  2. Upload the contents of the theme package to a new directory in the themes directory in your Drupal site. Place the theme in /sites/all/themes/stanford
  3. Click Administer > Themes and enable the new theme (Drupal will auto-detect its presence).
  4. Edit your user preferences and select the new theme. If you want it to be the default theme for all users, check the default box in the themes administration page.

Change Log

Stanford Header Sidebar Images

The /sites/all/themes/stanford/css/stanford_menus.css sets the various header images for some common menu lists used on either the left or right hand columns. To invoke these styles you must label your navigation lists with one of these specific names:

  • calendar
  • computing
  • contact
  • document
  • download
  • email
  • faq
  • forms
  • medical
  • people
  • related-sites
  • see-also
  • video

NOTE: these names are case sensitive.

Also included are some default menu blocks with graphics - these can be modified as or if you choose and are located at the end of the list. They are:

  • login (a.k.a #block-user-0)
  • admin (a.k.a. #block-user-1)
  • who's new (a.k.a. #block-user-2)
  • primary search (a.k.a. #block-search-0)

Media Links

The included medialinks.css as of version 1.93 checks the links based on the file extension, and adds an appropriate icon after the link showing the file format. For example, a link to a PDF file will automatically show an Acrobat icon directly after the text as part of the link. The current supported formats include PDF, DOC, DOCX, XLS, and PPT. It also has a new CSS authoring class called “external” which also provides an icon after a link, indicating that it is a link off of the current site.

Providing visual cues to users that a link goes to a document (PDF, Word, etc.) provides useful decision-making information. It addresses certain cognitive disabilities and is a best-practices recommendation. For even better accessibility, content authors should also indicate via the title attribute that the link is to a certain file type. Adding the total file size is helpful as well, especially if the document is large.

<a href ="pathtofile.pdf" title="Links to a PDF file">Name of File [245 kb]</a>

FAQ's

How do I customize the Stanford Drupal theme?

Download the sample Stanford Modern Drupal Custom Sub Theme package.

  1. Upload the contents of the theme package to a new directory in the themes directory in your Drupal site. Place the theme in /sites/all/themes/
  2. Click Administer > Themes to enable the new theme (Drupal will auto-detect its presence).
  3. Customize the sub-theme by editing the CSS file within the sub-theme directory.
  4. Edit /sites/all/themes/stanford_custom/stanford_custom.css to modify the stylesheet.

If you are managing your site using the collaboration tools upgrader for Drupal, creating a sub theme ensures that your customizations will not be overwritten during the upgrade.

The Stanford Modern Drupal theme is too narrow for content display within the administration interface. Is a wide version of the theme available for download?

  1. An administration Drupal sub theme is bundled with the Stanford Drupal theme.
  2. Click Administer > Administration Theme, select "Stanford Administration", click "Save configuration" to enable the administration theme.

How do I add text to the top red banner section?

  1. Go to Administer > Site Configuration > Site Information
  2. Enter text in the Site Name and Slogan text fields.

How do I add copyright text to the footer section?

  1. Go to Administer > Site Configuration > Site Information
  2. Enter the following in plain text in the Footer message text area:
&copy; Stanford University. <a href="http://www.stanford.edu/site/terms.html">Terms of Use</a> | <a href="http://www.stanford.edu/site/copyright.html">Copyright Complaints</a>

How do I add links to the footer section?

  1. Go to Administer > Site building > Menus > Add Menu
  2. On Add Menu screen, enter footer as the Menu name and Footer as the Title. Click Save.
  3. Add items to the menu by selecting the Add item tab. These items will become the footer links.
  4. Once you're finished with adding items to the footer menu, go to Administer > Site building > Blocks > List > Stanford
  5. Find the Footer menu item and move it to the Footer region. Save blocks.

How do I hide the authenticated user login text fields and allow only SUNet ID users to login?

  1. Add the following code to /sites/all/themes/stanford/custom.css
  2. You can still log in to your root account by going to http://[your site url]?q=user
#block-user-0 #edit-name-wrapper, 
#block-user-0 #edit-pass-wrapper, 
#block-user-0 #edit-submit, 
#block-user-0 .item-list {display: none;}

How do I create primary, secondary, or tertiary pages within Drupal? Can I migrate the primary.css, secondary.css, and tertiary.css from the Dreamweaver template packages?

As of November 30, 2008, one cannot create a primary or secondary page in Drupal without further CSS or template customization. Drupal uses a different system of CSS and templates that is different from the Dreamweaver templates. The Dreamweaver CSS files will not work properly in Drupal. You will need to create a custom theme if you want to recreate the primary or secondary pages in Drupal.

What happened to the search box in the red banner? How do I show the search box again?

The Stanford web search box is removed from the red banner header region as of version 1.9 of the Stanford Modern Drupal theme.

Enabling Drupal site search

  1. Go to Administer > Site building > Modules
    1. Enable Core - optional > Search by checking the check box and click "Save configuration"
  2. Go to Administer > Site building > Themes > Configure > Stanford
    1. Under Toggle Display, Enable the display of the search box by checking the check box and click "Save configuration"
  3. Go to Administer > User management > Permissions
    1. Check "search content" permission for appropriate user roles and click "Save configuration"

Adding the Drupal site search box to red banner header region

  1. Go to Administer > Site building > Blocks
  2. Find Search form in the blocks list, select the "Header" region, click "Save block"

Adding a Stanford web search box to red banner header region

  1. Go to Administer > Site building > Blocks
  2. Click "Add block" and enter the following:
    1. Block description: Stanford Search
    2. Block title: Stanford Search
    3. Block body:
      <form id="cse-search-box" action="http://www.stanford.edu/search">
      <div class="searchbox">
          <input name="cx" type="hidden" value="003265255082301896483:sq5n7qoyfh8" />
          <input name="cof" type="hidden" value="FORID:9" />
          <input name="ie" type="hidden" value="UTF-8" />
          <input name="q" type="text" />
          <input class="form-submit" name="sa" type="submit" value="Search" />
        </div>
      </form>
    4. Input format: Select "Full HTML"
    5. User specific visibility settings - Custom visibility settings: Select "Users cannot control whether or not they see this block"
    6. Role specific visibility settings: Leave all check boxes unchecked
    7. Page specific visibility settings - Show block on secific pages: Select "Show on every page except the listed pages"
    8. Click "Save block"

Example Sites

Help Resources

Personal tools