Creating a TGI

To begin the process of exploring TGIs, let's first create a new template gallery and a new TGI. To create your new gallery and TGI, follow these steps.

  1. While viewing the Template Explorer, right-click the Templates template gallery.

  2. From the context menu, pick New Gallery.

  3. After CMS has created the new template gallery, it will highlight the name and allow you to change it. By default, CMS names all new galleries "New Template Gallery." In our examples, we'll be working on behalf of BOTS Consulting, so our new template gallery will be called "BOTS Consulting."

  4. Once you've created your template gallery, right-click it and, from the context menu, pick New Template.

  5. As with the new gallery, CMS places a new TGI in your gallery and names it "New Template" by default. You can name your template anything you'd like. For the purposes of this exercise, we're going to call our new template "Generic."

If all has gone well, your Template Explorer should show you something similar to Figure 10-6. Please note that we've installed the sample site on our CMS server, so in addition to our new gallery, you'll see the WoodgroveNet gallery. If you've installed the sample site, you will also have that template gallery.

Figure 10-6. The Template Explorer with the new gallery and template added


You'll notice that the names of your new gallery and template are both shown in bold. Also, you'll notice that next to your template is a "broken" icon with a red check mark. We'll discuss the "broken" icon and the check mark later. However, let's address the use of bold now.

The use of bold on each object indicates that neither object has been "saved" to the repository. If you open the Site Manager and look in the template gallery, you'll notice that the objects exist, but their names have not been updated with the values you gave them (you may have to click the circular arrow button Global Refresh to see the new objects). In Figure 10-7 you'll see what we're talking about.

Figure 10-7. The Site Manager shows the new objects, but without the updated names.


In order to for your name changes to appear properly in the repository, you must save the changes to the gallery and TGI. To save the changes, simply right-click the object and select Save. Figure 10-8 shows this operation on the TGI. Be sure to perform the same operation on the gallery as well. Once you've saved the changes, you can go back to the Site Manager, click the Global Refresh button, and see the objects with the names you gave them in VS.NET.

Figure 10-8. Right-click the object and pick Save to commit the new name to the repository.


Now, remember the check mark and the "broken" icon on your TGI? The check mark indicates that the template is "checked out." A checked-out TGI can be edited by only one person. If you were in a multideveloper environment, this mechanism would allow your colleagues to see the TGI and view its properties, but would not allow them to modify it until you have checked it back in. As for the "broken" icon, it indicates that this TGI does not have a template file associated with it. We'll address that issue in Chapter 13, so for now, your TGI will remain broken.

NOTE: In the preceding examples, we demonstrated how to create one template gallery. Ultimately, once you begin developing your CMS site, you'll probably want to create one or more subgalleries to logically group your templates for your content contributors, or create multiple galleries representing the different sites you may potentially run in one CMS implementation. At BOTS Consulting, the development team has created a single gallery for their site. How you choose to set up your galleries will be based on a logical layout for galleries and any security requirements you may have. Since different user groups can be granted access to different galleries, creating various galleries may provide you with the flexibility of creating "advanced" templates, which are offered to only a few content contributors.

Microsoft Content Management Server 2002. A Complete Guide
Microsoft Content Management Server 2002: A Complete Guide
ISBN: 0321194446
EAN: 2147483647
Year: 2003
Pages: 298 © 2008-2017.
If you may any questions please contact us: