Completing Basic DotNetNuke Website Development in ASP.NET 3.5
In the first part of this tutorial, you learned how to start editing the DotNetNuke installation in Visual Web Developer Express. We also discussed how to start editing DotNetNuke websites using administrator/superuser panel. In this second (and last) part, you will learn how to edit the other important checkpoints for developing DotNetNuke websites.
Changing the header image/website logo and Copyright notice
If you look at the last screen shot in the first part, you will notice that the website still uses the old/incorrect logo (which is a DotNetNuke logo):
But the website is about selling alcoholic beverages, so it needs to be changed. To edit, follow the procedure below:
Step 1. Open the DotNetNuke project in Visual Web Developer Express.
Step 2. Once the project has been opened, go to the Default.aspx file of the website. Then go to File à View in Browser.
Step 3. The website will then be viewed using a web browser. Click the “Login” link in the home page.
Step 4. Log in as administrator/superuser.
Step 5. The administrator controls will then be shown after logging in. Examples of these important administrator controls are the “Page Functions,” “Add New Module,” “Common tasks” and “Edit content links.” In this step, click “Site” under “Common Tasks.”
Step 6. Expand “Appearance” under “Basic settings.”
Step 7. Under “Logo” à Click “Upload New File.”
Step8. Browse to where you have saved the new image logo for your website.
Step9. Click “Upload Selected File”
Step10. Click “Update.”
Step11. The header image of the website is now changed. Try to log out and the website should look like this:
Step 12. You can also revise the copyright notice using the procedure above. After clicking Site under Common Tasks, you will see the “Copyright” section under “Site Details.”
You might have noticed that when you browse the “Privacy Statement” and “Terms of Use” pages, they use the same title tag as the home page. Using duplicated title tags is not recommended by search engines such as Google.
Also you may wish to edit the content of the Privacy and Terms of Use pages. A good editing strategy is to remove the “Privacy Statement” and “Terms of Use” link in the footer of the website, create and then add new pages for terms of use and privacy statements.
By creating new pages, you can assign unique title tags for these pages.
Take the following steps to remove the footer links for Privacy Statement and Terms of Use in DotNetNuke:
Step 1. Log out as administrator in the DotNetNuke panel.
Step 2. Open the DotNetnuke project in Visual Web Developer Express.
Step 3. Go to View à Solution Explorer.
Step 4. Go to “Portals” à “Skins” à Expand “MinimalExtropy” à find index.ascx file, right click on it and click “Open.”
Step 5. You will need to remove the coding that governs the display of Terms of Use and Privacy statement links in the footer section of your DotNetNuke website. In the source provided, find and remove these lines of code:
Step 6. You will notice that the footer links for Terms of Use and Privacy statement will be gone after refreshing the pages. The next step is to log in as administrator in DotNetNuke panel.
Step 7. You will need to create new Terms of Use and Privacy Statements. To do this, under “Page Functions,” click “Add”.
Step 8. Let’s create the “Privacy Statement” pages first. Under “Page Details,” for example, you will enter information as follows:
Page Name: Privacy
Page Title: Privacy Policy
Leave the rest as default or blank.
However, under “Permissions,” check “All Users” under “View Page.” This is very important. If this is not checked, the pages you create will not be viewable by normal website visitors.
Step 9. Click Update.
Step 10. After creating the page, you will notice that DotNetNuke asked you to do two things:
a. Enter the header of the Privacy Policy page.
b. Enter your Privacy Policy content.
Enter content by clicking “Edit Content” links.
Step 11. Repeat Steps 7 to Step 10 for the “Terms of Use Pages” and “Contact Pages.”
Step 12. Log out as administrator, and the website should look like the screen shot below (now with “Privacy,” “Terms” and “Contact” pages added to the navigation menu).
This is a common problem when changing the Project Folder of the Website Path in DotNetNuke.
Suppose your DotNetNuke project in Windows Local host has this path: http://localhost:2738/dotnetnuke/. If you change your DotNetNuke project folder name to something else, for example “dotnetnukewebsite,” the path will be changed to: http://localhost:2738/dotnetnukewebsite/
This can be easy to do; you just navigate to your asp.net project folder and change the name of the folder (right click on the folder in Windows, then click rename).
Then using Visual Web Developer, go the project again (now using “dotnetnukewebsite”) and view the project in the browser (File à View in Browser). However, when the project is launched in a web browser, this error is shown:
Object reference not set to an instance of an object. Here is a screen shot of the error:
To remove this error, revise the portal alias of the website in the MS SQL Server database. The following are the steps:
Step 1. Open the project in Visual Web Developer Express.
Step 2. Go to View à Database Explorerà Expand “Database.mdf” à Expand “Tables”
Step 3. Scroll down and look for the table named “PortalAlias.”
Step 4. If you locate the table, right click on it and click “Show Table Data.”
Step5. You will notice that under the HTTPAlias column, the value still uses the old path of your DotNetNuke website, for example:
But the new path of the website is now http://localhost:2738/dotnetnukewebsite/. So you need to change the HTTPAlias from:
localhost/dotnetnuke
TO:
localhost/dotnetnukewebsite
Step 6. Again, view the project in the browser by going to the Default.aspx file; in Visual Web Developer go to Fileà View in Browser.
Step 7. The website should now display without the “Object reference not set to an instance of an object” error in DotNetNuke.
Here is another application: the example presented in this website is in a local host environment using Visual Web Developer Express. When you are about to move your website to a web hosting company and using the domain name of your dotnetnuke website, you also need to change the HTTPAlias of the website to reflect this changes and to avoid any error.
This two-part series presented the basic steps that the developer will go through to tweak the DotNetNuke website in order to have customized content, images, etc.
However, some advanced editing and development skills for DotNetNuke are still not covered in these two articles, but will be discussed in a future DotNetNuke tutorial series. These are the following issues that will be considered in a more advanced discussion:
1. Solving duplicate content issues between the /, Default.aspx and /Home.aspx. You might have noticed that the homepage of a DotNetNuke website can have 5 possible URLs, for example:
Google is case sensitive, meaning it will treat http://localhost:1644/dotnetnukewebsite/Home.aspx and http://localhost:1644/dotnetnukewebsite/home.aspx like two different URLs even though they have basically the same content. This leads to duplicate content issues; the solution is basically using the link rel canonical tag on these pages.
2. Adding a blog to the DotNetNuke website. A blog is a module that needs to be added to the default DotNetNuke installation. Of course, the default blog installation might not be SEO friendly, so it will need some onsite tweaks.
3. Moving the DotNetnuke website from the local host to a web hosting company, including its databases.
These three topics will be covered separately in future DotNetNuke tutorials here at ASP Free.