Introducing text-based menus

The simplest type of menu is the text-based menu, TMENU, which displays the page titles of menu items as text links. It's the fastest, drop-in solution for any menu, and it's what TemplaVoila created by default. The big advantages for TMENU are speed and flexibility. It's the fastest to implement, but it's also the fastest menu object to render because it's not downloading any special graphics or complex layouts during the loading of our page.

It also means that your design is not tied to the TypoScript template, so you can do all your customization through CSS or even JavaScript libraries. If you're designing for CSS3-compatible browsers and you really know what you're doing, then you can build a very fast menu with custom fonts and effects that degrade gracefully across unsupported browsers without TypoScript. We are going to look at ways to integrate non-web fonts and complex graphic effects using TypoScript in this chapter because, for those who aren't CSS or JavaScript geniuses already, TypoScript is easier and more flexible. Almost anything is possible, with TMENU, CSS, and JavaScript.

What are the disadvantages? Obviously, the main disadvantage can be appearance. If your designer has handed you a folder of mockups with fancy graphical menus, then they are not going to be impressed with our text-based navigation. If you want fancy buttons, but you're still designing for legacy browsers and graceful degradation (displaying functional but less advanced designs to older browsers) is not an option, you'll need to use GMENU with GIFBUILDER.

If you build enough websites, you will end up using various menus at different times, but TMENU is both a great starting point for new projects and a nice alternative when we need the basic functionality of our navigation.

TMENU Properties

As a child of HMENU, TMENU shares some common properties with the other menu objects, but there are some specific TMENUITEM properties that can be modified for the items in a text-based menu:

Property

Description

beforeImg

We can specify an image to be displayed before the menu entry with beforeImg. This property is an imgResource, so we can simply declare the file we want to display as a link, or we can expand and use the more advanced properties of an image resource discussed in the TSref (width, height, and so on). We will use some of the advanced properties in our examples.

beforeROImg

This declares an image to be displayed on rollover in conjunction with beforeImg. To use this, we must enable rollovers on our menu.

beforeImgLink

The beforeImgLink property will link the beforeImg image with the same information as the text link in the menu item if this is set.

afterWrap, afterImg, afterROImg, afterImgLink

These properties function similar to beforeWrap, beforeImg, and so on. to add images and wrapped elements after the text menu item.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.8.133