DNN websites, modules, skins and support

Menu: Blog

Print and RSS action icons in DNN 6, a solution

By:
Print and RSS action icons in DNN 6, a solution

Because of changes to the action menu in DNN 6, the Print and RSS feed icons don't work anymore.
At first I didn't notice this as they do work if the user is logged in, but for an anonymous user they don't.

I'm sure this will be solved in a future update of DNN, but there are people who upgraded to DNN 6 and only discovered this issue when it was to late to "downgrade".

Here's one of the Forum threads: http://www.dotnetnuke.com/Resources/Forums/forumid/109/threadid/428780/scope/posts.aspx

I found a (temporary) solution to for the issue.
The following code blocks should be injected in place of the original Print or RSS action button in the Container's ascx file:

For Print:

            <%  'Print action alternative for DNN 6 Timo Breumelhof - 40Fingers
                Dim sPrint As String = "<a href='http://{0}/tabid/{1}/mid/{2}/dnnprintmode/true/Default.aspx?SkinSrc=[G]Skins%2f_default%2fNo+Skin&ContainerSrc=[G]Containers%2f_default%2fNo+Container' target='_blank'><img src='/images/action_print.gif' alt ='Print' /></a>"
       
                If Me.ModuleControl.ModuleContext.Configuration.DisplayPrint = True Then
                    Response.Write(String.Format(sPrint, PortalSettings.PortalAlias.HTTPAlias, PortalSettings.ActiveTab.TabID, Me.ModuleControl.ModuleContext.ModuleId))
                Else
                    Response.Write(String.Empty)
                End If
                %>

For RSS:

            <%  'RSS action alternative for DNN 6 Timo Breumelhof - 40Fingers
                Dim sRSS As String = "<a href='http://{0}/tabid/{1}/moduleid/{2}/RSS.aspx' target='_blank'><img src='/images/action_rss.gif' alt ='RSS' /></a>"
       
                If Me.ModuleControl.ModuleContext.Configuration.DisplaySyndicate = True Then
                    Response.Write(String.Format(sRSS, PortalSettings.PortalAlias.HTTPAlias, PortalSettings.ActiveTab.TabID, Me.ModuleControl.ModuleContext.ModuleId))
                Else
                    Response.Write(String.Empty)
                End If
                %>

BTW, this has one advantage, as it does not use any Javascript, the new window is opened without a warning.

I did not test this in a multi-language environment, I think it should work with the core localization, but I guess not with the other solutions.
(although it should not be difficult to add the language parameter)

Hope this helps,

BTW, I might create a skin object from this if there's a demand for it.

If you want to add a Print.css stylesheet for printing to your skin, read this blog post.

Timo