SolutionBase: Adding modules, menus, and categories within the phpWebSite environment

phpWebSite is a powerful content management system that will help you customize your Web site. Here's how you work with some of the phpWebSite modules.

This article is also available as a TechRepublic download.

The phpWebSite system is one of the most versatile content management systems available. From intra-company content sites to full-blown commercial sites, phpWebSite can fill most any need you have. Beyond installation, you will need to be able to customize and add on to the system to make it work for you. In this article, we are going to discuss how the WebSite system works as well as how you can customize the look and content of your company's site.

The look and feel

One of the highlights of working with phpWebSite is the ability to customize the look and feel of the system. Although some graphical ability is required to handle some of the customizations, a good majority of the alterations can be done very simply and very quickly. Let's take a look at some of the first items to customize once a phpWebSite site is set up.

Adding/using modules

Within phpWebSite, a module is a small subsystem that handles a single task. From the basic installation you have a good list of basic modules to choose from:

  • Announcements
  • Blockmaker
  • Calendar
  • Comments
  • Documents
  • FAQ
  • Help
  • Menumanager
  • Module Maker
  • Pagemaster
  • Photoalbum
  • RSS Feeds
  • Polls
  • Search

A quick Google search will help you find plenty of other modules, including a shopping cart with PayPal ability.

What do you do with these system modules once they are installed? Let's take the Calendar module as an example and find out.

The Calendar module is one of the modules your Content Management System will take advantage of most often. You will notice the small calendar in the lower left side of your site (see Figure A). This calendar will show events as links within the module. Click on the link, and the event information is shown.

Figure A

The Calendar module is the one you'll use most often.

To configure the Calendar module, log in to the phpWebSite system with your administrator username/password and click on the Control Panel link. Click on Site Content, and then click on the Calendar link. Once in this configuration window, notice the Settings link near the top. Click on that link and you will be greeted with the various settings available for the Calendar, as seen in Figure B.

Figure B

You can change calendar settings here.

From this settings screen, you can chose to show the mini calendar view or just a "days ahead" view (as well as configure how many days ahead you would like to display). Figure C displays how the "days ahead" view looks. Clicking on the title of the event (in our case "Test Event") will display the details of the event.

Figure C

Here's a different view.

Other Calendar configurations include:

  • Cache Calendar Views: Check this box if you want the calendar to cache some of its pages. This can increase the speed of some views (especially month and year).
  • User Submitted Events: Check this box if you want to allow users to submit events.
  • Reindex FatCat: If you have deleted an event and it is still showing up in What's Related, check this box. FatCat is the phpWebSite categorizing system which allows the administrator to create categories that will help develop a "What's Related" indexing system.

From the settings window, you can also purge events from a selected date by choosing the date from the drop-down lists and clicking Purge FatCat Entries Before button.

A little sidebar on FatCat: At first, you may think that the categorizer in phpWebSite isn't really worth the time and effort. Make no mistake about it. This tool will make your life (and your Web site's capabilities) so much better in the long run. Take the time to create the various categories that are relevant to your business. You won't regret it.

Creating an event

Creating an event requires two separate actions. The first action is the creation of the event. The second action is administrator approval of said event. To create the event one only need to click the Submit event button on the front page of your site (within the Calendar module). From the Submit Event page, it is simply a matter of filling out the necessary information. However, there are some tricks to this process with regards to Event Type. Here are the definitions of those types:

  • Interval: When an event has a definite start and end time, choose this option.
  • Starts At: When an event has a definite start time but an unknown end time, choose this one.
  • Deadline: When the end of an event is more important than when it starts, use this one.
  • All Day: When an event is defined more by the day it is on than when it starts or ends (e.g. Holidays).

When I first started using the Calendar module, I was attempting to create events under the assumption that the Starts At and Deadline options were the correct combination. Wrong! Most events will fall under the Interval category because most events have both a start and an end time.

Once you have created and submitted an event, the event must be approved by an administrator. Although this can be a hassle, it should be fairly obvious why this step is necessary. You don't want spammers or practical jokesters placing inappropriate events on your calendar that could lead to serious problems.

The approval of events is taken care of in the Administration tab (within the Control Panel). If you click on the Approval link, you will see listed each event awaiting approval. You can approve, disapprove, or ignore each event, as shown in Figure D.

Figure D

You can also view the event to make any changes or delete any unwanted content.

Now what about FatCat?

FatCat categorizes all of the information on your Web site. But before FatCat can do so, you must first set up various categories related to your company. Let's say your company is an ISP and plans on offering various packages for customers (Plan A, Plan B, and Plan 9). Your first step is to go to the Control Panel and then to the Site Content tab. In this tab you will see the FatCat link. Within FatCat you should click on the Create Category button (to the right of the Top Level drop-down). Within the new window you will title and describe the new category. When creating your first category you only have the option of making the new category a child of the Top Level category. Once you create a new category you can then make child categories of the new category.

Say you want to create a category called Packages. Once you have created the Packages category, go back to the FatCat categorizer and click on the Create Category button. Now you can make your Plan packages as child categories of the Packages category. Also, from within the creation window, you can upload an icon for each new category. This will serve as a nice visual reminder of what the customers are dealing with. Once you have created the categories there will be more than just the Create Category button available. Now you will see the Edit Category and Delete Category. These should be self-explanatory.

From within this same administration window the "What's Related Limit" can be set. What this configures is the number of What's Related items that appear under an article. This is a very handy tool for a Web site selling items because when a customer looks at a particular item (or package) they will see all items that relate to the one they are looking at on the same page.

In order to actually use the What's Related feature you will have to know how to create a Web page in phpWebSite. Creating a Web page is simple. Go to the Control Panel and then to the Site Content tab. From within the Site Content tab click on the Web Pages link and then on New Page (near the top). The first thing you do is title your new page. We'll title our page "Plan A". The next step is to select the categories you want related to Plan A. Currently we have only the "Packages" and "Plan A" categories. So click on "Packages" and then, with the control key pressed, click "Packages > Plan A". The other configurations are self-explanatory. This entire procedure creates the header for the page. Now you have to actually create the page contents. Once you click the Go button (at the bottom of the page) you will then start creating your page.

The best way to set up the pages is to break the page into sections. Each section will have a Section Title and Section Text. You can also insert images, descriptions, image URLs, and image template. The image template configuration can be a bit tricky. If you click on the drop-down you will see a long list of selections. You should select the image location from this list. Once you are finished with the page (and all of its sections) you must press the Save Page button or the page will not be complete. Alas, you are not finished with this page. When you press the Save Page button you will be returned to the Web Pages page which lists all of your creations. In order to have your new page show you must click the Show link for your new page.

But how can your users see the page? The system itself does not create a link for the new page. What you have to do is click the Edit link for your new page, scroll down to the bottom of the page edit screen, and select a menu for this page to belong to. The only menu you will have available at this point is the Menu (convenient eh?). Select that and then click Continue. Now you need to give this menu entry a name. We'll call this Plan A. Underneath that section you can select where this menu item belongs. Since we haven't created other menu items we'll make it a child of the Top Level (which is the default.)

Now that you've created a Web page, and configured a category with that page, you will have to successfully create more pages before the What's Related box will show up. Once you have created more pages (that are also set to similar categories), a new box will appear when you view one of the related pages showing any page that is a member of the category or related category.

What's on the menu?

As mentioned before, it's fairly simple to add a new page to a menu. But what about adding a previously created page or an external page to the menu? Fear not. Help is on the way.

On the Site Content tab, you'll find the Menu Manager. The Menu Manager is where all menus are created, edited, and deleted. With a fresh install of phpWebSite, there will reside only one menu within Menu Manager, and it's called, simply, Menu. Click on the Edit link associated with the "Menu" menu. Within this window, you'll see all sorts of options. You can move menu items up and down the hierarchy, you can activate/deactivate items, add new items, add module defaults, configure the settings of the menu, and turn on the advanced edit feature.

Let's first look at the Add Module Default button. Just as it sounds, this button will allow you to add any of the various modules to your navigation menu. Say, for instance, you want to add the Announcements module to your menu. From the drop-down list select the Announcements module, check where you want the child menu item to reside (we'll use Top Level), and then click the Add Menu Item button. Viola! The Announcements item is now living in your menu.

But what if there is an external Web page/site that needs to be linked to within your menu? Simple. Click the Add Menu Item button, enter the page/site's name, enter the page/site's URL, select where you want the menu entry to reside, and then click Add Menu Item. One note of caution: If you are directing a user to another site, make sure you select New Window from the Display drop-down list. If you do not select New Window, when the user clicks on the link, the user will be directed away from your site in the current active window (In other words, your site will no longer be there for the user without his/her Back button.)

The Settings button houses a few very interesting items. From this location you can configure the title of your menu, the space between menu entries, the template or your menu, the orientation of your menu (vertical or horizontal), and the Menu Indent of your entries. The last item is nice because it allows you to configure a character or an image to be used in conjunction with the menu entry name. If you select "None" then your menu will consist only of the entry names.

One other tool in the Menu Manager kit is the Image Manager. This is the location where you upload all of the images you will use for your menus. Uploading is a simple matter of Browsing and Uploading. Once your images are uploaded you can then choose to delete them from this same section.

That's just the beginning

There are a ton of configurations/customizations to be had with phpWebSite. With a little work and a little time, phpWebSite will quickly become your system of choice when creating new Content Management Systems, new client systems, and company store-fronts. You are bound only to your imagination with phpWebSite.

By Jack Wallen

Jack Wallen is an award-winning writer for TechRepublic, The New Stack, and Linux New Media. He's covered a variety of topics for over twenty years and is an avid promoter of open source. For more news about Jack Wallen, visit his website jackwallen....