Each of these modules handles a different type of content, as is hinted at by their name, and each offers a different amount of functionality for visitors to interact with the content. We will see all of this, and also see how each module organizes the content it manages.
The Content module, as the name suggests, simply handles content. The Content module is handy for adding general pieces of information to your site, which are not particularly time-sensitive or intended to generate discussion.
The ‘content’ of the Content module is called a content page, and content pages may be organized into categories. Note that these categories have nothing to do with the categories created for news stories. In fact, several of the modules in this article will organize their content into ‘categories’, and there will be no relation between the categories of one module and the categories of another module.
Content pages are not searched by the Search module.
There are no comment features or ratings available for Content content, and only the administrator may add pages; there is no place for user-submitted content here.
In versions of PHP-Nuke prior to 7.5, there was a module called Sections, which was almost identical in functionality to Content, with the addition of an image for the categories. From PHP-Nuke 7.5, the Sections module is no longer shipped with the standard installation of PHP-Nuke, and we will not consider it any further.
Like the other modules, the Content module is not activated by default, if you didn’t activate the Content module before, do so now.
Time For Action—Creating a Content Category
- Log in as administrator.
- To access the Content administration area, click on the Content link in the Administration block, or click on the Content icon in the Modules menu:
- In the Add a New Category panel, enter the text Site Documents into the Title field.
- Enter the following text into the Description field: Here you will find a collection of documents about the site.
- Click the Add button.
- When the page reloads, there isn’t much evidence that your category has been entered, but if you scroll down the screen to the Edit Category panel, you will find the category in the Category drop-down box:
What Just Happened?
We just added a content category. They are added from the Content Manager area of the administration area. The disconcerting thing is that it’s difficult to tell if your category has been added successfully; there is no list of the content categories displayed in the Content Manager area. You will have to look in the drop-down box in the Edit Category panel to confirm that your category has indeed been added.
Now we have a category, let’s add some pages.
Time For Action—Adding a Content Page
- In the Content Manager area of the administration area, scroll down to find the Add a New Page panel.
- Select Site Documents from the Category drop-down box.
- Next comes the Header Text. Enter the following into that field:
- The Page Text field contains the body of the page. We’ll enter the following:
Collection of your Personal Information
We will ask you when we need information that personally
identifies you (personal information) or allows us to contact
you. Generally, we request this information when you are
registering before ordering products from theDinosaurPortal.com,
downloading or viewing limited-access content, entering a contest,
ordering email newsletters. In each circumstance we try to limit
the information we request to the minimum required to deliver the
service to you. We also use various standard technologies such as
cookies to track user activity on our sites.
Use of your Personal Information
We use your personal information for the following purposes...
- There are two fields remaining, Footer Text and Signature. We’ll enter this for the Footer Text:
If you require any further assistance, please contact firstname.lastname@example.org
and this for the Signature:
the DINOSAUR PORTAL – Just because you’ve never seen one, doesn’t mean they’ve all died out…
- Click the Send button.
- When the page reloads, the details of our first page are visible in the Content Manager panel, confirming its creation:
- Now click on the Content link in the Modules block, or go straight to http://localhost/nuke/modules. php?name=Content. You will see the list of content categories:
- Click on the Site Documents link, and you will see the list of content pages in this category:
- Click the Next Page link to see the rest of the document:
What Just Happened?
We just added a content page, and then viewed the page. We assigned the content page to the Site Documents category when we created the page. It is possible to create content pages that do not belong to any category. The current list of content pages is shown in a table in the Content Manager area; we saw this screenshot at the end of step 11.
When you visit the front page of the Content module, the list of categories is displayed. Only the categories that have content pages associated with them are displayed. Also, if there are any content pages not associated with a category, their titles will be listed here.
Clicking on a category takes you to a list of the content pages associated with that category. This list is ordered by the date on which the pages were entered; the content page created first is displayed at the top of the list and so on. For each content page, the text entered into its Title field is displayed in this list, along with the Sub-Title in brackets. Clicking on the title of a content page will take you to display of the page itself. The following diagram shows this navigation hierarchy:
Note that there is no direct link to go back from the content page to its ‘parent’ category. You will have to use the Back button of your browser to do this. You can get back to the list of all categories by clicking the Content link in the Modules block, but you will still need to click again on the category to display the list of content pages it contains.
Returning to our privacy content page, we see that our content page has been split into two pages. This is done by inserting the text into the Page Text field, which forces PHP-Nuke to break the page at that point. The contents of the Page Text field form the body of a content page, with the Title and Sub-Title always displayed at the top.
The Next Page pager is automatically provided by PHP-Nuke, and with that you can navigate through the pages of the content page. On the first page, the Header Text is displayed before the Page Text starts, and on the final page, the Footer Text is displayed at the end of the Page Text, followed by the Signature text. A copyright notice, including the site name, follows the Signature, and then there is the date the page was created, followed by the number of times the page has been read.
Since we were still logged in as an administrator, at each part of this journey there are panels allowing you to edit the details of either the category or the content pages. For example, there is a panel for altering the category on the page displaying that category’s content pages, in addition to a ‘content page editing’ panel on each page of the content itself:
Any of these links can be used to change the object in question. Of course, these links are visible only to an administrator. No visitor will be able to see these links or access their functionality.
Deactivating a page makes it invisible to a visitor from the list of available content pages, and the page will not be displayed even if the visitor manages to enter the URL of the content page. The administrator will be able to see a list of deactivated pages on the front page of the Content module (http://localhost/nuke/modules. php?name=Content) or in the Content Manager area of the administration area.
The pid value of the query string is the unique identifier for this piece of content in the same way as we saw the story ID when looking at stories. This value will not change with subsequent modifications of the content page, or even moving it to another category.
The Content Block
The Content block is part of the standard PHP-Nuke installation, but isn’t loaded. You can load this block from Blocks area of the administration area by selecting Content from the Filename dropdown, and choosing a title for the block as usually done for file blocks.
Once the block is activated, it will display a list of the titles of all active content pages, with links to view each content page in full.
Note that the Content block will still display the list of titles present in the content pages even if the user does not have read access to the Content module.
Categories can be edited or deleted through the Edit Category panel in the Content Manager area. Simply select a category from the drop-down box and click the Edit button to go to the Edit Category page. Here you can edit the title and description of the category, or delete the category.
Note that deleting the category does not delete the content pages associated with that category. All pages in a deleted category are preserved, but no longer belong to any category (they belong to the None category!).
You can create a special administrator with rights to only the Content module in the Edit Admins menu of the Administration Menu.
Access to the Content module is done on a ‘whole module’ basis. The visitor either sees nothing or everything. You cannot configure individual categories or content pages to be viewed by certain user groups.
Points and Prizes
There are no activities in the Content module that contribute any points towards a user’s point score.