Principles of good print stylesheet designs

We've seen that the print style for existing Magento themes is often not to the same standard as the styling for the computer screen and other mediums. Before starting our theme's print stylesheet, it's important to take note of some good practices in creating print stylesheets, as well as the limitations of print stylesheets.

Limitations of the print stylesheet

Many options that may be defined within the print stylesheet, such as whether or not to print images within the page, can be overwritten. This means that even with the best intentions when writing our store's print stylesheet, it will never be ideal for every browser and for every customer.

We just need to decide what information will be displayed when each page in our store is printed, and what information we wouldn't want to print.

Print preview

There is no reliable way to disable the print preview feature of a browser; quite rightly, as it should remain a choice of the web site's visitor.

Gecko-based browsers

One well-documented quirk of print stylesheets occurs in some Gecko-based browsers. When a long div element is floated with CSS, these browsers tend to ignore any content that is not printed on the first page where the div element occurs.

This can be quite easily bypassed with the addition of float: none to the relevant div tags in our store's print stylesheet.

What we should show

The primary content of each page should be printed. For most pages on our Magento store, this will include information such as the price and description of a product, as well as photographs of it.

Logos and store names

It's a good idea to include your store's logo and its name. If the printed page of your store is lost and found weeks, or even months later, then these will make it easier to recognize that page.

Promotional graphics and callouts

It's okay to print promotional graphics such as callouts, so long as they don't get in the way of the primary content of the page being printed. Generally, this means that it's better to make sure callout graphics are printed below or perhaps alongside the details of the product.

Bear in mind that some customers will print just the page that they want, which may mean that they don't see the promotional graphics when printed, and as mentioned, some visitors may even have disabled images from printing.

Links

A major problem with printing web pages is that the links within each page can lose their use. This is because, by default, the destination of the link is not shown. We can use CSS to append each link within the page being printed with the URL of the link, as we'll see later.

What we can hide

As we saw in the sample print stylesheets that we looked at earlier, there is also a lot that we can hide to lower the amount of content our store's customers need to print. This includes:

  • Navigation and links to pages that are not related to the current page. There is little point in printing your store's navigation and footer links, as once printed, your customer won't be able to click on them!
  • Search boxes—there's no use in printing this, as a printed copy of the page cannot be used to search.
  • Popular product tags can't be clicked upon. Thus, they're of no use.
  • Shopping basket—there is not much need for this to be printed most of the time, but this is a matter for you to consider.

Background images

Background images and unnecessary background colors can be removed using the print stylesheet with the aim of reducing the amount of unnecessary information that is printed.

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

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