|
|
|
About the Site
The fictional company Bigabyte returns for this
Case Study. The company is assumed to be of medium
The
The various news modules will also be shared throughout the site cluster, and the Categories field will be used to create department-specific postings. For any given submission, an article can be posted globally to all departments or privately to only the one department's site. The Stats, Languages, Hooks, and Comments modules will also all be combined during the Multisites setup.
This intranet will be themed using the full
Professional version of AutoTheme. The example site is commercial,
which is important for
|
|
|
|
|
|
|
Applying What You've LearnedNow, the following sections walk through the development of the site and combine the techniques learned in the previous chapters. Website Install and PreparationAll Multisites installations need multiple host entries to handle the different domains for each branch. This Case Study has eight different sites, and the Apache VirtualHost entries look like the following sample code: <VirtualHost *> DocumentRoot /www/bigabyte.intranet ServerName intranet.bigabyte.com </VirtualHost> <VirtualHost *> DocumentRoot /www/bigabyte.accounting ServerName accounting.bigabyte.com </VirtualHost> <VirtualHost *> DocumentRoot /www/bigabyte.admin ServerName admin.bigabyte.com </VirtualHost>
Each of the branches of the intranet Multisites cluster needs a separate install of PostNuke. Copy the same PostNuke files into each of the different directories defined for the web server. They will share the same database, but each install must be set up to use a different table prefix. Try taking the
Table 26.1. Database Table Prefixes
The
config.php
files for each site should be respectively configured to use these prefixes for their tables. These sites are also designed to be
After the
From the Modules Administration table, the AutoLinks, Banners, Ephemerids, Quotes, Reviews, and Xanthia modules should be deactivated for every site. This helps simplify the Administration Menu for the different sites. AutoTheme will be used by all of the sites, so install this module throughout the cluster.
Note
AutoTheme is available in 5 and 10 license
The database changes required to make a Multisites cluster work should be completed before too much effort goes into customizing each branch. This not only makes the site development easier, with single changes from shared
Combine the user accounts between all the sites by sharing these tables:
group_membership
,
groups
,
priv_msgs
,
user_data
,
user_property
,
userblocks
, and
users
. Don't share the
group_perms
or
user_perms
tables to make each site's access different. For example, one department might have content managers who can administrate its site, but on other department branches those
News is shared through the autonews , stories , stories_cat , topics , and queue tables. To combine the Admin Messages module, change the message table. In addition, given that this site also has a known set of users, there's no reason not to combine the language tables languages_constant , languages_file , and languages_translation . Then, any additional languages installed for one department branch are automatically available to the entire intranet site.
The site statistics should be combined to ensure realistic data. For example, an employee who
The shared tables need to be
Tip
If you are careful while choosing search wording, you can
With the last of the pntables.php changes saved, the Multisites cluster is complete and the frontend development can begin. Module Setup and HacksThe News module tables are shared across all of the sites, but the built-in categories will be used to separate postings for different department sites. From the Add Story form, add additional categories for each department. Use the "Default Articles" edit described in Chapter 22, "News and Article Hacks," to change Articles to All Departments. Articles can now fall under the customized department categories shown in Figure 26.1. Figure 26.1. Posting globally or privately with specialized categories.
The Article Title and Links hacks should also be used to remove the Section name from being displayed with different articles. The permissions will be set to disallow the access to categories that are not relevant to a particular department. For example, HR employees submitting articles will only see the All Departments and Human Resources categories. The hack changes need to be made to each installation of PostNuke, but after you change a file, it can easily be
The User Registration Configuration under User Administration should be set to simplify the account creation process by not validating email addresses and removing the age check. These fields on the Dynamic User Data page can all be disabled: Fake Email, Homepage, ICQ, AIM, YIM, MSNM, and Interests. Smaller businesses might also not need the Time Zone Offset, Location, or Occupation fields. Additional fields can now be added, though the specific field needs will vary for different businesses or organizations. Some suggested fields are listed in Table 26.2. Table 26.2. Optional User Data Fields
{% if main.adsdop %}{% include 'adsenceinline.tpl' %}{% endif %} The wording of various messages should be adjusted at this point by editing the different modules' global.php files, and the user system can be polished further with other changes, such as the login timer bar, as discussed in Chapter 24, "Login System Hacks and Modules."
The separate installs of PostNuke for each site allow the different departments to customize their sites with different modules. For example, the Human Resources department can use the Web Links module to list job openings. The links can be made directly to internal documents or a wrapper can be employed to integrate the site with a separate job application system. Accounting can similarly link to current budget
Pagesetter is a good choice for the Marketing department to create a custom content system for company information and press releases. Development, Marketing, and Sales can collaborate using Pagesetter to document product materials for customers.
Administration and Information Technology can use the Advanced Polls module to get instant feedback on different issues announced in the Admin Messages posting. Information Technology might also find the FAQ module a great tool for creating a
Because the user system is combined, any employee of the company simply needs to visit the respective department site to access the information the department provides to the rest of the company. Groups and Permissions
The new groups must first be developed so that permissions can be assigned. The same groups are used for the entire cluster, so it does not matter from which site the group changes are made. The Admins group is kept but renamed to Global Admins. This group will have administrative access to all sites. Because the default Admins group already has those privileges, it's easy to use that
The default users group is also kept with the same access rights installed by default. For this example, the users of a given department can submit content and make comments to any site in the cluster. An unlimited number of site and permissions settings combinations are available, which could be used with Multisites, and
Two new groups need to be created for each site in the cluster: Site Admins and Managers. The first group will have identical access to the Global Admins, but only for one department site. The Managers group allows selected users to oversee and approve content within a specific department site. The prefixes used for the database tables can be used here to shorten the group names. Figure 26.2 illustrates the group setup. Figure 26.2. Groups for a Multisites cluster.
With the groups table shared, creating the different names from any site makes them available from all others in the Multisites cluster. Sharing the group_membership table means when you add a user to one of these groups, the membership also carries automatically to all of the other sites.
Permissions for each branch site build upon the default settings. The Users group permission granting Comment access should be edited to apply to All Groups. This edit drastically
Above line two where All Groups are restricted from the Main Menu's Administration link, add two new entries for the Site Admins and Managers groups needed for each respective site. For the Sales department site, the first entry is: Site Admins - Sales .* .* Admin And the second should look like this: Managers - Sales (Stories::Admin_Messages::Sections:: Topics::Web_Links:: Menublock::) .* Delete The Site Admin entry gives group members complete access to the Sales site, but because these permissions do not carry to other sites in the cluster, they are only users elsewhere in the Multisites cluster. The second entry grants full content management access for Managers to main content modules. If additional content modules like Pagesetter or pnESP are installed, they should be added to this line. The final entry for MenuBlock ensures Managers will see the Administration link in the Main Menu. The basic hierarchy for the site permissions is now set up.
Next,
All groups Stories::Category (AccountingAdministrationDevelopmentHuman ResourcesInformation Technology Sales):: None And the second should contain this: All groups Stories::Story :(AccountingAdministrationDevelopmentHuman ResourcesInformation Technology Sales): None
The first prevents access to the non-Marketing categories, for example from the Add Story form. The second
That completes the global changes needed for all departments, but each department has other unique settings that should be added. The Admin Messages module can be restricted to allow posts from specific departments, such as Administration and Information Technology. The line should be above the Site Admins entry and look like this: All Groups Admin_Messages:: .* Read Any other module can be rendered read-only to a department with an addition to that line. Figure 26.3 shows how these settings can be combined for the Human Resources department permissions. Figure 26.3. Permissions for the Human Resources department.
Note
For sites in which content modules are restricted, the Managers entry can also be simplified, removing the modules from which they are restricted. But because the restriction
Interface
Intranets are focused on functionality over form and
$currentsite = "Administration";
$departments = array("Accounting", "Administration", "Development", "Human Resources",
"Information Technology", "Marketing", "Sales");
echo "<div style=\"width:100%; height:33px; background-image:url('". $imagepath
."images/nav-bg.gif');\"><table cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%;
border:0px;\"><tr>";
for ($i = 0; $i < count($departments); $i++) {
$class = "navoff";
if ($departments[$i] == $currentsite) { $class = "navon"; }
$imgname = "offoff";
if (($i == 0) and ($class == "navon")) { $imgname = "lefton"; }
elseif (($i == 0) and ($class != "navon")) { $imgname = "leftoff"; }
elseif (($i != 0) and ($class == "navon")) { $imgname = "offon"; }
elseif (($i != 0) and ($departments[$i-1] == $currentsite)) { $imgname = "onoff"; }
echo "<td><img src=\"". $imagepath ."nav-". $imgname .".gif\" /></td><td
class=\"$class\">$departments[$i]</td>";
if (($i+1) == $count($departments) {
$imgname = "rightoff";
if ($class == "navon") { $imgname = "righton"; }
echo "<td><img src=\"". $imagepath ."nav-". $imgname .".gif\" /></td>
}
}
echo "</tr></table></div>";
Take this code and apply it to all the department sites through the creation of a new AutoTheme command, and for each site's theme, change the $currentsite variable to reflect the local content (see Figure 26.4). A reusable navigation system can also help maintain consistency when a department theoretically has the ability to change nearly everything about its site. Figure 26.4. Simple navigation for Multisites.
The different departments can use the AutoTheme templates and AutoBlocks to customize their employee interface greatly. Contrast the Human Resources and Information Technology branches. The HR uses older transitional-level XHTML blocks in a traditional PostNuke layout. The following is an example of the left-side block code:
<div style="width:160px; height:33px; background-image:url('{image-path} leftblock-
back.gif');">
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>
<td style="width:100%; text-align:center; font-weight:bold;">» <!-- [block-title] --></td>
<td style="width:13px;"><img src="{image-path}leftblock-head.gif" /></td>
</tr></table></div>
<div style="background-color:<!-- [color2] -->; padding:5px; border-right:5px solid <!--
[color2] -->;"><!-- [block-content] --></div>
<div style="background-color:<!-- [color2] -->; height:5px;"><img src="{ image-
path}space.gif" style="width:5px; height:5px;" /></div>
<div style="background-color:<!-- [color4] -->; height:1px;"><img src="{ image-
path}space.gif" style="width:5px; height:1px;" /></div>
<br />
The IT branch site breaks from the left/right format by structuring all content in AutoBlocks. It uses more current XHTML with an emphasis on styles. The cascading style sheets (CSS) for the blocks is written as this:
.itblock-title { background-position:top right; background-repeat:no-repeat; padding:8
8 0 8; color:#000; font-size:13px; font-weight:bold; text-transform:uppercase; }
.itblock-body { background-position:bottom left; background-repeat:no-repeat;
padding:0 8 8 8; font-size:11px; font-weight:normal; }
The use of styles and a tableless structure greatly simplifies the individual block code to the following:
<div style="width:170px; background-color:#FFF;">
<div class="itblock-title" style="background-image:url('{image-path}itblock-top.gif');"><!-
- [block-title] --></div>
<div class="itblock-body" style="background-image:url('{image-path}itblock-
bottom.gif');"><!-- [block-content] --></div>
</div><br />
The separate AutoTheme installs truly mean each site could be completely different from the others, while still sharing the underlying database structure and content. The freedom to develop with different designs, coding styles, and standards levels within the same Multisites system makes it possible for more developers at different skill levels to collaborate on the project. |
|
|
|