Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Module titles rendering as " "Module titles rendering as " "
Previous
 
Next
New Post
6/29/2010 1:53 AM
 
Hi guys,

Ive hacked up a little container object which returns JUST the modules title as plain text, unformatted etc. Im using this skin object to pass a variable to a flash movie so that I can get flash based module titles in my client preferred font/colors etc.

Anyway, for the most part it works.

Occasionally, the titles dont work - and when I check the pages source, its rendering the titles just as " " and not the module title. This only seems to happen in "View" mode - when I go into "Edit" mode, the title renders perfectly.

Just wondering if anyone had any ideas why this would happen?

This is my skinobject Ive called "lTitle.ascx"
--
<%@ Control Language="vb" AutoEventWireup="false" Inherits="DotNetNuke.UI.Containers.lTitle" CodeFile="lTitle.ascx.vb" %>

--

And the CodeBehind
--
Namespace DotNetNuke.UI.Containers
    Partial Class lTitle
        Inherits UI.Skins.SkinObjectBase
        Const MyFileName As String = "lTitle.ascx"
        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Try
                Dim objPortalModule As Entities.Modules.PortalModuleBase = Container.GetPortalModuleBase(Me)
                Dim strTitle As String = Null.NullString
                If Not objPortalModule Is Nothing Then
                    strTitle = objPortalModule.ModuleConfiguration.ModuleTitle
                End If
                If strTitle = Null.NullString Then
                    strTitle = " "
                End If
                litTitle.Text = strTitle
            Catch exc As Exception    'Module failed to load
                ProcessModuleLoadException(Me, exc)
            End Try
        End Sub
    End Class
End Namespace
--

Im registering the objects via the module skin with
--
<%@ Register TagPrefix="dnn" TagName="TITLE1" Src="~/Admin/Containers/lTitle.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TITLE2" Src="~/Admin/Containers/lTitle.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TITLE3" Src="~/Admin/Containers/lTitle.ascx" %>
--

And Im calling the flash (with fallback) via this code...
--
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="40">
  <param name="movie" value="/Portals/_default/Containers/JaniKing Intranet/title.swf?thisTitle=<DNN:TITLE1 runat="server" />" />
  <param name="quality" value="high" />
  <param name="wmode" value="opaque" />
  <param name="swfversion" value="8.0.35.0" />
  <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
  <param name="expressinstall" value="/Scripts/expressInstall.swf" />
  <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
  <!--[if !IE]>-->
  <object type="application/x-shockwave-flash" data="/Portals/_default/Containers/JaniKing Intranet/title.swf?thisTitle=<DNN:TITLE2 runat="server" />" width="100%" height="40">
    <!--<![endif]-->
    <param name="quality" value="high" />
    <param name="wmode" value="opaque" />
    <param name="swfversion" value="8.0.35.0" />
    <param name="expressinstall" value="/Scripts/expressInstall.swf" />
    <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
    <span style="color:#333333; font-family:'Helvetica', Arial, Helvetica, sans-serif; font-weight: Normal; font-size: 28px;"><dnn:TITLE3 runat="server" id="dnnTTITLE3" /></span>
    <!--[if !IE]>-->
  </object>
  <!--<![endif]-->
</object>
--


So... in "view" mode... this is whats happening..




As you can see, its (for whatever reason) replaced the title with "&amp;nbsp;"...

This is the exact same page in "Edit" mode...



Does anyone have any suggestions? Ive spent 2 days trying to work this out, and Im stumped!!

Thanks!
 
New Post
6/29/2010 8:08 PM
 
One thought (which I haven't tested out): Container.GetPortalModuleBase() is marked in the DNN source code with "Deprecated in 5.0. Shouldn't need to be used any more. ContainerObjects (IContainerControl implementations) have a property ModuleControl." The implementation of this method uses FindControl() which from memory has a lot of issues. Maybe in some cases FindControl() fails to find the module - this would get the behaviour we're seeing. Except I don't know what those cases could be.
 
New Post
6/30/2010 4:14 AM
 
Check this:
http://dnnskinextensions.codeplex.com...

You need different code for DNN5
 
New Post
6/30/2010 7:37 AM
 
Hi Ky,

Just a couple of thoughts in addition to what's already been said;
  • If a module has a blank title DNN returns "&nbsp;" (without the quotes) - I'm guessing this is to prevent containers distorting with empty elements around the title value.
  • If your "litTitle" is a Literal control then it looks like it's HtmlEncoding the contents (hence "&nbsp;" becomes "&amp;nbsp;") - check the Mode attribute.
Good luck,
Rhys 

www.rmjcs.com - Mostly SQL Server Stuff
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Module titles rendering as "&nbsp;"Module titles rendering as "&nbsp;"


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out