Friday 29 April 2011

Configure Users Online in DotNetNuke

Users Online is very good module to display number of users at the site. Also it allows to show usernames of users at the site. To configure Users Online the module it needs to do few steps:

Friday 22 April 2011

Create new page for DotNetNuke in background

Prehistory:
Some customers need to create a lot of pages at one time. This is why "Bulk Pages Creation" has been added to the Pages Admin - Tabs Manager. But few days ago one customer submitted bug. He tried to create about 500 pages in bulk. Less then 100 have been created, but other have been failed. Problem is httpRuntime executionTimeout in the web.config has small time and after 90 seconds (default value) it fails.

History:

Thursday 21 April 2011

Number of versions in HTML module (DotNetNuke)

By default HTML module for DotNetNuke has deep of versions equal 5. And there is no way to change it with user interface. This is not good, because sometimes we need more versions to save.

We can fix it easy. Number of versions located in the Portal Settings table and can be easy changed with query like this:

UPDATE {databaseOwner}{objectQualifier}PortalSettings
SET SettingValue = '5'
WHERE (SettingName = 'MaximumVersionHistory') AND (PortalID=0);

All you need is just replace '5' with number of versions you need and PortalID with ID of your portal (usually 0).

Do not forget after this query restart Application Pool (Host/Host Settings/ Restart Application). It should update a cache.

Hope this helps!

Tuesday 19 April 2011

How to add break to the ModuleActions for DotNetNuke module

Sometimes in the module for DotNetNuke there are a lot of Actions, like this:


It is not good for usability. Would be better to group items somehow with small breaks between Actions in the list, like this:
As you see breaks between items in the menu makes it more user friendly and grouped. it is very easy to add breaks like this, just need to pass special character "~" for Title for ModuleAction object. Here is example of code (C#):


Actions.Add(GetNextActionID(),
"Suppliers",
DotNetNuke.Entities.Modules.Actions.ModuleActionType.AddContent,
"", "", EditUrl("Currency"), false, DotNetNuke.Security.SecurityAccessLevel.Edit, true, false);


Actions.Add(new DotNetNuke.Entities.Modules.Actions.ModuleAction(GetNextActionID(), "~", ""));


Hope this helps!

Monday 11 April 2011

Reverse SiteUrls in DotNetNuke

DotNetNuke made very good solution for custom URLs. This is SiteUrls.config file. It allows to add to this file something like this:

<RewriterRule>
<LookFor>.*/About.aspx</LookFor>
<SendTo>~/Default.aspx?TabID=40</SendTo>
</RewriterRule>

When your customers type something like http://mysite.com/About.aspx DotNetNuke Portals shows correct page from tabid=40. Issue happens when you click this page in the menu. Instead http://mysite.com/About.aspx it shows http://mysite.com/About/tabid/40/Default.aspx.

It confuses clients and search bots. Bots can penalize, because it looks like duplicates of content. This is why our team made small additional. It makes reverse lookup in the SiteUrls.config and replaces with related URL (if any).

Additional is free and opensource and available at codeplex.

Saturday 9 April 2011

How to refresh favicon.ico in the browser

Got small problem. After changing favicon.ico it has no affect for browser (Google Chrome). Both F5 and Ctrl+F5 do not help. The most popular recommendation in the web is to clear all history and cache in Google Chrome. This is not good solution for me, because a lot of settings for my work.

After small research i found a way how to do this easy. Just need to type in the address line 

http://yoursite.com/favicon.ico

it shows your old icon, then click Ctrl+F5 and it shows correct one now. Then back to the site. See? Icon has been updated.

Hope this helps!