Example One: Telephone Directory
For this example we are going to create a telephone directory listing all our Photographers. Some of them have paid to have their entries formatted in certain ways - e.g., in bold, or with an extended listing that includes their address and specialty; those that haven't will just get a plain listing.
Step One: Set up a Publishing Style Sheet
The Publishing Style Sheet we are using for this project
is called Telephone Directory (to view or edit Publishing
Style Sheets, choose Publishing Style Sheets from the Publishing menu). It looks like this:

Perhaps the most important thing
here is the list of Paragraphs. This is where we specify exactly what
data is going to be published and how it will be formatted. In this example, we've set up one Paragraph for each different formatting style. When the data is transferred to QuarkXPress or InDesign, CatBase will decide how to format each photographer's details depending upon which Listing Level he has selected (Plain, Bold, Boxed, or Extended).
Elements are the building block of Paragraphs; each Paragraph can contain
any number of Elements. There are seven element types:
- Data from a field in the database (First Name, for
example)
- Static text (such as "Specialty: ")
- A formula. Formulas are a very versatile tool which
enable you to tell CatBase how to make decisions about what to include
- or leave out - and optionally, how to format it.
- Punctuation (such as a tab character)
- A calculation (for example, you could discount all
prices by 15% for a sale catalogue)
- A picture
- A relation (relations enable you to include information
from a related table. In our example, the Pictures table is related
to the Photographers table so when we are publishing Pictures, we can
easily include information about the photographer who owns each picture, and vice versa).
A quick look at the Plain Entry paragraph (double-click
on it in the list of Paragraphs) shows us that it is comprised of six
elements:

As you can see, the first Element is a Formula which reads "If Listing Level equals Basic then Include this Paragraph otherwise don't include this paragraph". Each Paragraph in this Publishing Style Sheet contains a similar Element, and this is what controls how each photographer's entry will be formatted. The Formulas are created using a simple point-and-click interface - this is how the one shown here looks:
.
The detailed workings of Publishing Style
Sheets are covered in a separate Tutorial.
Step Two: Select the data you want to publish
We're going to include all the Photographers in this directory. Simply click on the Photographers button on the Data floating palette and then click on All Records.
Step Three: Transfer the data
With the list of Photographers displayed,
choose Publish all These Records from the File menu, select
the Publishing Style Sheet you want to use (Telephone Directory
in this case), and hit the Save button to create the transfer
file.
Step Four: Import the transfer file into your Quark or InDesign template
Note: We use the Xtags Xtension for importing the file into a QuarkXPress or InDesign document, as this facilitates the creation of text and picture boxes. We have included
a demo version of Xtags with our demo (you'll find it in the 3rd Party
Demos folder).
Open up your template, or create
a new two-column document in Quark or InDesign. We have included a simple template in the Goodies folder
with the CatBase demo.
Now for the fun part ...
- With your document open, make sure that the insertion
point is in the first text box.
- Choose Get Text with Xtags ... from the File menu (if it isn't there, that means you haven't installed Xtags in your
plugins folder!)
- Select the file you just created.
- Make sure that the Include style sheets check
box is checked
- Click on the Open button
Watch in amazement as the directory is created before
your very eyes! It should look like this:
 |
Mohammed, John, and Mike have paid for a Bold listing.
Ferdinand and Kate have a plain listing.
Sheila has paid for a Boxed listing.
Jenny has an Extended listing.
... and it was all formatted automatically! |
Example Two: Personalized Letters
In this example, we want to create a personalised letter for each photographer. We want to include a variable comment depending upon which country they live in, and to include a thumbnail of each of their pictures that we have on file.
To create the letters:
Step One: Set up the Publishing Style Sheet
We've set up a Publishing Style Sheet called Thumbnail Letters. (See above for a bit more info about Publishing Style Sheets).
Step Two: Select the Photographers we want to send letters to
Click on the Photographers button on the Data floating palette and then on View All Records.
Step Three: Publish the Data
Choose Publish All These Records ... from the File menu, select the Thumbnail Letters Publishing Style Sheet, and click OK. CatBase creates a text file containing the data and formatting instructions.
Step Four: Import the transfer file into your Quark or InDesign template
Open up one of the templates we have supplied (you'll find them in the Goodies folder), or create a new Quark or InDesign document. Make sure that the document has been saved into your CatBase folder, otherwise it won't find the pictures!
Now for the fun part ...
- With your document open, make sure that the insertion
point is in the first text box.
- Choose Get Text with Xtags ... from the File menu (if it isn't there, that means you haven't installed Xtags in your
plugins folder!)
- Select the file you just created.
- Make sure that the Include style sheets check
box is checked
- Click on the Open button
Watch in amazement as the letters are created before
your very eyes! They should look like this:
 |
Mohammed's address has been included and the introduction personalised ("Dear Mohammed,")
There's a customized message re. Morocco.
Thumbnails of his pictures are included.
... and it was all formatted automatically! |
Now all
you have to do is print the letters!