PageSetter


For those who need more than just an upgrade to News or Sections, PageSetter is the module of choice. It is designed to suit whatever content storage and display needs you might have. It can reproduce news in formats mirroring the regular PostNuke News module, but PageSetter can become anything from a complex document archive to a business directory listing to a personal recipe system. PageSetter lets you define every field, and, therefore, can become any type of information storage system you need. On top of that, PageSetter includes additional features not available with either of the previous modules, including revision control, a workflow system, and multiple approval levels for content.

This section looks at version 5.0 of PageSetter. You can download the module from the online book materials, or alternatively, pull a current version from its website (www.elfisk.dk).

The PageSetter archive includes a root folder for the module, but it also includes the modules folder. You need to unzip the file into a temp directory and move the module contents manually, or you'll want to decompress it from the site root and not from inside the modules folder on your site. Initialize and activate PageSetter from your Modules Administration table.

PageSetter looks very unassuming in the beginning with a very simple interface (see Figure 12.11). Re-creating the news system of PostNuke can be easily accomplished, but you can build a system that's a bit more outside the box: a recipe database. The techniques used to build the system can, of course, be applied to any other custom content storage system you need.

Figure 12.11. Beginning with PageSetter.


You must first define the publication type before being able to enter any content into it. It's like designing a form template in order to enter data into the created fields. Publication types let you use PageSetter for different needs in your site. For example, you can create different types for news, static articles, contact listings, and this recipe example all at the same time. The news could be displayed on your home page while you display links to recipes in a side block.

Create a new publication type. In the Title field, enter Recipe, and enable PN-Hooks. The check box provides built-in PostNuke features, such as comments and scoring for your publication.

Workflow determines the process content takes from submission to being online for users to see. The None, Standard, and Enterprise options mean "no approval, online immediately," "Admin approval, like PostNuke standard," and "Two approval levels, editing and final," respectively. The Wiki options new to PageSetter 5 provide some Wiki-style features to PostNuke. With Wiki set, anyone can create, edit, and delete any publication. MyWiki allows creation by anyone, but users can only edit or delete their own content. In the Workflow drop-down list box, choose Standard.

The rest of the form has two parts. The List Setup area determines how publications are ordered when displayed together, as News posts on the home page, for example. The second area, Publication Fields, is a table of all the actual content entry fields for your publication. As the List Setup can order entries by fields you create, you should add the fields first.

Tip

Plan out all the fields you need for your publication type before you begin. It can save a lot of reorganization time later.


Use Table 12.1 to generate the new Publication fields. Add short descriptions for each field, if desired. The final field labeled Recipe Type requires a new List Type be set up. For now, select String for its type value.

Table 12.1. Recipe Publication Fields

NAME

TITLE

TYPE

SEARCHABLE

name

Name

String

Yes

description

Description

Text

Yes

ingredients

Ingredients

Text

Yes

directions

Directions

Text

Yes

preptime

Prep Time

Time

No

cooktime

Cook Time

Time

No

servings

Servings

Int

No

type

Recipe Type

Recipe Type

Yes


Additional lines can be added using the green + link on the left of each row. The one in the header adds a line at the end, and each entry link adds a new line above the one you clicked. When you are done, your table should look similar to the one in Figure 12.12.

Figure 12.12. Adding fields to your publication.


Commit your changes to the publication type. Click New List under the Lists navigation menu to create the Recipe Type field type. Enter Recipe Type for the title, and add a description. Use the New Item fields to add a series of recipe types. For this example, use the same text for both the Title and Value fields. The items will be displayed in the order they are created by default, but you can edit the order and formatting by clicking on the items in the list. In Figure 12.13, you can see the Beef entry is out of alphabetical order. The control popup menu allows you to move the item up.

Figure 12.13. Controlling your lists with a click.


Now return to your Publication Types list, edit Recipe, and change the final field to a type of Recipe Type. Commit the change. Back at the Publication Types page, now click the New link at the right end of the table.

Enter in a few test recipes to see how the form works. You can mouseover the question mark icons to see the descriptions you entered for the different fields (see Figure 12.14).

Figure 12.14. Field descriptions appear with a mouseover.


Next from the navigation menu under Publications, select the Create Templates option. PageSetter can autogenerate template files for your publications. The files are placed in /modules/pagesetter/pntemplates/ where you can edit them later. Check all the boxes to create a new set of templates for the Recipes, and submit the form.

Now, you can create a new block to display links to the data. Browse to the Blocks Administration table and create a new entry with the type "pagesetter/PageSetter list N publications." Title it "New Recipes" and submit the form. Now, you can configure your list block. Set the position to "Right" and the publication type to "Recipe Type." The OrderBy field needs the value "core.lastUpdated:desc" to show only the most recent posts.

The template name should be just "list." PageSetter template filenames are built using the known publication name, the template name you supply, and the file extension. So, if the filename is Recipe-list.html, you need only enter "list" in the field. PageSetter also automatically adds the -header and -footer to the template filenames as needed.

Commit your changes and take a look at your completed block. It should look similar to the one shown in Figure 12.15. The item has no formatting due to the empty templates, but the functioning foundation is there for you to build upon.

Figure 12.15. A PageSetter block example.


Now, you look at another one of PageSetter's impressive features. Like PagEd, PageSetter can import data from the PostNuke News module, from Content Express, and from an XML schema file. When accomplishing an import, PageSetter creates the new publication type, and all the fields associated with it, automatically.

Use the PageSetter navigation menu to select Import Data from the Tools option. You are presented with a very simple set of forms. Along with importing all News items for you, PageSetter also creates an image field for the new PN-News Publication by checking the top box.

To see how a more standard publication type works, you can import in the old news. Check the image check box and click the Import News button.

Note

Importing news multiple times is technically possible, but it creates multiple publication entries of the same name, which make it hard to tell them apart. Unlike PagEd, however, you can simply delete the extra publication to fix the double import.


Edit the new publication type PN-News created by the import. You can see it has done nearly all of the work toward creating a news system for you. The Publication fields (see Figure 12.16) account for all the regular features expected of a PostNuke News module, and now you can easily add additional fields to expand.

Figure 12.16. News publications created the easy way.


Now go to your Website Configuration form in PostNuke Administration and set your site's Start Page to "pagesetter." Return to the PageSetter administration area and select General under the Configuration menu. The first option on this page selects which publication to use when the Frontpage of PageSetter is accessed. Set it to "PN-News" and save the change.

Now go to your site's home page. The news articles are displayed just like the core News module, but with the addition of the PageSetter template formatting (see Figure 12.17). You can edit the templates easily to create any look desired.

Figure 12.17. PN-News as your PostNuke home page.


Granted, PageSetter takes more time to develop a usable content system than many other modules. But after the setup work is completed, there really is no module more powerful for creating a dynamic information website. If you need complete flexibility, PageSetter is the module for you.



    PostNuke Content Management
    PostNuke Content Management
    ISBN: 0672326868
    EAN: 2147483647
    Year: 2003
    Pages: 207
    Authors: Kevin Hatch

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net