Setting the Defaults

CollapsableMenu Single Line Menu
    WebMenu Documentation >>  Creating Menus in Python >>  Setting the Defaults
QuickNavigationMenu QuickParentNavigationMenu
<< >> << ^ >>
MultiLineMenu
Introduction | Creating Menus in Python | The WebPage Class | The HiddenPage Class | The WebMenu Class | Using XML to define a Web Menu object | Q&A | CSS Declarations
Setting the Defaults | Adding Pages and Menus

WebMenu returns HTML formatted text for anchors and assumes that the style is controlled by a Cascading Style Sheet reference and that each anchor is assigned a CSS class. There are four variables that WebMenu keeps track of to give links their CSS class. It is important to keep in mind the difference between a link and a menu. A link is essentially an anchor tag in the final HTML. A menu is a list of anchor tags.

SetPageClass
Sets the CSS class name assigned to links to WebPage objects. The default is "page".
SetMenuClass
Sets the CSS class name assigned to Menus. This is the CSS class assigned to the HTML block defined by the MenuTag. The default is "menu"
SetLinkClass
Sets the CSS class name for individual links to WebMenu objects. The default is "page".
SetHereClass
WebMenu can produce various menus, and it assigns the menus a different style so they can be different on the final page. For example, the words "Setting the Defaults" and "Creating Menus in Python" should be drawn differently than the other menu items. The default value is "here".

When WebMenu creates HTML for a menu, it wraps the entire menu with one tag. If it crates multiple menus it will wrap them each separate from one another (MultiLineMenu is an example of this). You can use the following functions to customize how the menu will work as HTML:

SetMenuTag(s)
After calling SetMenuTag(s) every menu you create will use s for a tag. WebMenu does not check that s is a valid HTML tag. The default value is p but both d and span are logical choices for menus.
SetLowercase(t)
Sets the preference for HTML tags to be in uppercase or lowercase. The default is lowercase. Use SetLowercase(0) to have the HTML in upper case.
SetNoBreak(t)
Sets the option for Titles of links to replace spaces with non-breaking spaces. This is on by default. Call SetNoBreak(0) to turn this feature off. With this feature set the only line wrapping the browser should do is between menu items
SetSeparator(s)
Sets the default Separator between menu items in MultiLine Menus. This is by default a · ( &middot; ) character surrounded by one space on either side.

Back to my code page Back to my home page ©2003 english@spiritone.com