Creating Sub-Sites within a Single Install

Sub-sites can be setup within a single AssetNow installation providing mini-sites with independent navigation, search, and visual designs. Sub-sites are useful for marketing campaigns, product promotions, and departmental sites.

Sub-sites can be setup within a single AssetNow NX installation providing mini-sites with independent navigation, search, and visual designs. Sub-sites are useful for marketing campaigns, product promotions, and departmental sites.

Whilst developers can customize AssetNow NX templates and widgets to cater for sub-sites anywhere within the site structure, we recommend using permissions. With this method you create a category below the AssetNow NX site root (home) folder for each sub-site. Group permissions are assigned to the category, by switching the active group you can display the different categories. By using permissions navigation and search results will be restricted to the contents of the category.

1. Setup Access Groups

Using the AssetNow NX Permissions tool create a Group (user group) for each sub-site. Note the Group ID value for each group you create. Set the access permissions to Link. This means a URL containing the Group ID must be used to access content assigned to this group. Do not assign any Users to the group. You may apply restrictions such as IP addresses or Country (location) however during setup and testing it is easier not to have any additional settings.

2. Create Sub-site category

Using the AssetNow NX Content tool create a category for each sub-site directly below the AssetNow site root (home) category (folder). Make a note of the Category ID for each sub-site. Assign read permissions to the Group created in step 1 that will be used to access the category. Permissions are used to display a selected sub-site and restrict navigation and search results to categories and content within the sub-site category. The group permissions are set when the visitor enters the URL or clicks a link setup with the Category ID and Group ID.

3. Publish Sub-site Content

Add sub-categories and content to the sub-site by publishing inside the category created in step 2. From a publishing point of view the sub-site is the same as any other category, however you may configure specific category and content templates for each sub-site. We recommend naming templates using the sub-site name as a prefix, for example: subsite_template_name. AssetNow NX lists all available templates in the Category/Content template select list, by giving templates a sub-site prefix will make it easier to identify them.

4. Accessing the Sub-site

Test the sub-site by accessing it with the required Category ID and Group ID value as noted previously. The AssetNow NX URL format is:

/index.cfm/a,b,c,d,html where a, b, c, d are all numeric values and

  • a = AssetNow NX request processing action (appaction), the default is 1 = display
  • b = Category ID, default is 1 = root (home) category
  • c = Content ID, default is 0 = no content page selected
  • d = Group ID, default is 0 = built-in anonymous everyone group (all visitors belong to this group)

Example: We create a Group called "Subsite 1", let's say it has a Group ID = 22. We create a top level category for the sub-site called "Subsite 1", let's say the Category ID = 47. Set group read permissions for this category to "Subsite 1" via the category permissions tab, making sure to un-check the Everyone group.

Navigate to the site home page (1,1,0,0,html) and then enter the URL 1,47,0,22,html. The sub-site category is displayed. The site map and search results are also restricted to the sub-site category group permissions.

5. Redirecting to Sub-Sites

A number of options are available to direct visitors to sub-sites. These include:

  • Publish an access page (portal page) in the site root folder. On this page provide specific links, with the required Category ID and Group ID to each sub-site.
  • Create subdirectories and add redirect scripts to direct visitors to the required sub-site.

    Example: For "Subsite 1" site we create a directory named /sub1 on the web server. In this directory add a default template (typically index.cfm) with a ColdFusion script redirecting to the required category using the Category ID and Group ID:
<cflocation url="#application.virtualPaths.ANROOT#/index.cfm/1,47,0,22,html" addtoken="no"/>
  • In the site home (root) category use the Category Body to add conditional redirection code that checks the domain name used access the site and redirects accordingly.

    Example: We have a number of domain names (subsite1.com, subsite2.com) all pointing to the same AssetNow NX install. We want visitors to be redirected to the corresponding subsite based on the domain name they use to access the site. The ColdFusion code below checks the domain name used to access the site and then redirects to the corresponding sub-site. If there is no match then it redirects to a default sub-site:
<cfif findNoCase("subsite1.com",cgi.server_name)>
   <cflocation url="#application.virtualPaths.ANROOT#/index.cfm/1,47,0,22,html" addtoken="no"/>
<cfelseif findNoCase("subsite2.com",cgi.server_name)>
   <cflocation url="#application.virtualPaths.ANROOT#/index.cfm/1,48,0,34,html" addtoken="no"/>
<cfelse>
   <cflocation url="#application.virtualPaths.ANROOT#/index.cfm/1,33,0,54,html" addtoken="no"/>
</cfif>

6. Customization

In addition to creating specific templates for sub-site categories and content, developers may want to customize navigation, search and site map widgets. Typically you may want to remove the default "Home" link that points to the AssetNow NX root category, or modify widgets so that the "Home" link points to the top level category of each sub-site. You can do this with conditional code to check the sub-site Category ID.

Location

http://www.assetnow.com/index.cfm/1,84,295,html

Copyright © Orbital Limited 2010

Learn More        Try It Now!        See Versions and Pricing