DotNetNuke Skins and Resources by ThinkofDesign

Posted by Vasilis on Sunday, January 18, 2009

How to avoid the SPAN in the dnn:TITLE 

This is just an answer to a question posted on my twitter from @horacioj.

It's about how to avoid the SPAN and get a clean heading tag in a DNN container title.

Below you can see the code for a simple container that demonstrates exactly that.

 <%@ Control language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Containers.Container" %>
<%@ Register TagPrefix="dnn" TagName="TITLE" Src="~/Admin/Containers/Title.ascx" %>
<%@ Register TagPrefix="dnn" TagName="Actions" Src="~/Admin/Containers/Actions.ascx" %>

<dnn:title runat="server" id="dnnTitle" visible="false" />
<% Dim ModuleTitle As String = GetPortalModuleBase(dnnTitle).ModuleConfiguration.ModuleTitle %>

<div class="common">
<h3><%= ModuleTitle %></h3>
<dnn:Actions runat="server" id="dnnActions" />
<div id="ContentPane" runat="server" />
</div>

I have to mention though that with this implementation, the inline title editing won't work.



Comments

Ralph Williams Ralph Williams says:

Wow! This was an annoying problem. Great Tip!

sameer sameer says:

thanks man
i search about it

Dax Davis Dax Davis says:

Vasilis, that is a geniusly simple solution. Thanks! Gonna start using this immediately.

Dax

Dax Davis Dax Davis says:

Your note about inline editing is a good thing to pay attention too. But I have a site where I use Cufon and when a user edits the title it puts a bunch of canvas tags and other things in there. Had a client REALLY screw up a site that way.

George Lew George Lew says:

Brilliant! This help me a lot in the design and SEO.

rudgr rudgr says:

Can it be that this is not working anymore in 5.1.4?
It works only in Edit mode, not in View mode anymore

Ralph Williams Ralph Williams says:

Vasilis,

I am having the same issue as Rudgr. Any ideas on about this?

I use this all of the time and am going crazy w/out it ;)

Thanks,
Ralph

Vasilis Vasilis says:

I'm listening to you guys...

Looks like a security issue as it does work when you're logged in.

I'll try to find out.

Ralph Williams Ralph Williams says:

Vasilis,

I was wondering if you have found an answer to the DNN v5 security issue with this technique.

I really miss it :(


Name (required)

Email (required)

Website

Enter the code shown above: