Friday, March 13, 2009

DotNetNuke: Creating Sub-Portals

Once you know how to do this (creating sub-portals) – it turns out to be a very simple thing to do, but before I figured it out, I spent a little while trying to fumble around with the settings to get a new sub-portal going.

The first thing you need to know is that DotNetNuke portals come in 2 flavors:

  • Parent and
  • Child

Parent portals are portals which have their own unique address. (eg: www.portal1.com and www.portal2.com)

Child portals are portals that live within a parent portal. (eg: www.portal1.com/childPortal1 and www.portal1.com/childPortal2)

Here is how you create them:

  • Login to your DNN site. Go to Host –> Portals image
  • Click on “Add new portal” image
  • Select the appropriate type of portal image If you select Parent, then you must enter the name of the portal If instead you select Child, then you must enter a sub-folder name for your portal image

Creating a parent portal on a local dev machine:

If you are developing your DNN portals on your local machine then you might have it configured like this:

Main DNN installation:

File system: c:\inetPub\testDnn500Site

URL: localhost/testDNN500Site

You will then be able to very easily create child portals having address like the following

localHost/testDNN500Site/ChildPortal1

localHost/testDNN500Site/ChildPortal2

But what if you want to try creating a parent portal (one that you could call using the URL: localHost/myTestParentPortal)? Well that involves a couple of more steps:

  1. Create a virtual directory in IIS which points to the same folder as the DNN installation (in this case c:\inetPub\testDnn500Site). Give it the alias that you wish to use as your parent domain (in this case “myTestParentPortal”).
  2. Login as Host into DNN and create a new parent portal. Set the portal alias to “localhost/myTestParentPortal”.

And that is it, you are done.

Note:

There is a school of thought, that one should never use a child portal (one that is accessed using sub-folder path). The reason for this is that some modules might record information such as links using the full path (portal/sub-portal). So if your portal name changes, than you might be in a world of hurt. (Obviously this does not matter if you never envision changing your main portal name). And now that you know how to create parent domains on your local dev box, you arent confined to using child portals.

Reference: Overview of the Portals Page: http://www.dotnetnuke.com/Support/Help/tabid/787/TID/3800/cid/568/Default.aspx

All portals page help topics: http://www.dotnetnuke.com/Support/Help/tabid/787/Default.aspx

1 comment:

rlively said...

Exactly what I was looking for - except that when I hit http://localhost/myTestParentPortal, DNN redirects to the http://localhost/testDnn500Site ... which works, but it doesn't show the Portal alias I chose in the URL. Is this expected?