Please note this is a DotNetNuke 5+ only version.

Add to skin

Add to an ASCX skin:
<%@ Register TagPrefix="dnn" TagName="FF_SIMPLETITLE" Src="~/DesktopModules/40fingers/skinobjects/simpletitle/SimpleTitle.ascx" %>

<dnn:FF_SIMPLETITLE runat="server" id="ffSIMPLETITLE" />

Add to a DNN5 HTML skin:
<object id="ffSIMPLETITLE" codetype="dotnetnuke/server" codebase="FF_SIMPLETITLE"></object>

Remarks:
This skin object can be used in both a skin and a container.
In a skin the page title will be rendered, in a container the module title.

Trim spaces & Hide the Title

Space characters will be stripped from the title by default and when the result is nothing, noting will be rendered.

This allows you to hide the title including a heading element by entering a space as the title.
(<h2></h2> could render a margin for instance even if the title it empty, which is not always desirable)

The nice thing about this is that you can also hide the element surrounding the title with that.
With this definition:
<dnn:FF_SIMPLETITLE runat="server" id="ffSIMPLETITLE" Template="<h2>TITLE</h2>" />

You would get
<h2>My Title</h2>

When the admin enters a space character as the title, nothing will be rendered.

If you require the <h2> to be always rendered, simply add the h2 outside the skin object.
<h2><dnn:FF_SIMPLETITLE runat="server" id="ffSIMPLETITLE" /></h2>

Replace the core skin object:

- Install the skin object
- Open your containers ASCX file and replace this line:
<%@ Register TagPrefix="dnn" TagName="TITLE" Src="~/Admin/Containers/Title.ascx" %>
With this:
<%@ Register TagPrefix="dnn" TagName="TITLE" Src="~/DesktopModules/40fingers/skinobjects/simpletitle/SimpleTitle.ascx" %>

And you are done.

Last edited Dec 5, 2012 at 12:53 PM by Timo_Design, version 7

Comments

No comments yet.