Community Documentation

Styling and Theming

Last updated November 2, 2009. Created by NancyDru on August 2, 2008.
Edited by rmiddle. Log in to edit this page.

The Weblinks module is replete with classes that may be styled to your liking and to fit best with your site.

Style Sheets

There are three CSS files distributed with the module. If you don't like the out-of-the-box styling of the module, you may rename one of the others to "weblinks.css".

weblinks.css
The standard distributed styling that highlights the data that the developers feel are important to this module.
weblinks_minimal.css
A very "vanilla" CSS that does almost no styling so that your theme can take over.
weblinks_fancy.css
A "fancy" style sheet that "punches up" the module's output. It uses color values chosen from the default Garland color set (Blue Lagoon). This means you may switch the module to the basic file and then copy the "fancy" CSS into the default Garland "styles.css" and the Color module will convert those colors into values that are appropriate for the color set you choose when you configure the theme. [NOTE: This probably requires a small, but safe, hack to the Color module.] No longer applicable to the 6.x-2.x branch of the module.

Theme Functions

weblinks_comments($node)
Theme comment links.
Parameter:
$node - Object containing the node information.
Return:
String containing the formatted info.
weblinks_group_settings($form)
Theme the group settings form.
Parameter:
$form - Object containing the node information.
Return:
String containing the formatted form.
weblinks_info($node, $account)
Theme the info fields.
Parameter:
$node - Object containing the node information.
Parameter:
$account - Object containing the user information.
Return:
String containing the formatted info.
weblinks_pagedesc()
Theme the page description.
Parameter:
none
Return:
String containing the formatted info.
weblinks_status($node)
Theme the link status.
Parameter:
$node - Object containing the node information.
Return:
String containing the formatted status or null if status is okay.
weblinks_user_form($form)
Theme node administration overview.
Parameter:
$form - Object containing the node information.
Return:
String containing the formatted form.

Tips and Tricks

  • Two Columns (all groups) - You may want to show your output in two columns (this can actually be extended to as many as you want) by a small alteration to the CSS.
    1. Locate this in "weblinks.css"

      .weblinkCat {
      clear: both;
      }

    2. Change it to this:

      .weblinkCat {
      /* clear: both; */
      width: 48%;
      float: left;
      }

    3. Refresh the display.
  • Two Columns (top groups only) - This is a modification of the above, but does the top level groups only.
    1. Locate this in "weblinks.css"

      .weblinkCat {
      clear: both;
      }

    2. Change it to this:

      .weblinkCat {
      /* clear: both; */
      }

      .weblinkCat-depth-0 {
      width: 48%;
      float: left;
      }

    3. Refresh the display.
  • Overriding the Presentation - This comes from one of our issues in which the requester wanted the page title and URL to be different from the normal way the module is written.
    1. To change the page title (normally "Web Links"), simply go to the menu admin page (admin >> site building >> menus), and alter the menu title. For example, you may want it called something like "Resource Links."
    2. To alter the URL (well, you don't really, just the way it appears), you use a URL Alias, which requires the Path module (core) to be enabled. Go to the URL Alias admin page (admin >> site building >> URL alias), and enter a new alias for the path "weblinks" to whatever you want. In keeping with the above change, this would be something like "resource_links.html."

 

nobody click here