I had a request from my users to allow any email or URLs entered into a User Defined Table module in DotNetNuke to be automatically Hyperlinked. This tutorial shows you how to modify the stored procedure to allow for this.

I figured out the easiest way without having to modify any of the base modules was to modify the stored procedure that returns the rows for the table. In the following procedure it was modified to check the value of the field to see if it contains either a “@“ or “http://“. This is done using the TSQL CASE statement, which basically checks for the condition that the FieldValue field contains what were looking for, if it does, then we add the appropriate HTML string to the field so it will display as a hyperlink, if not then it just displays the data within the field.

In addition, for this stored procedure there is an additional “Order By“ statement included which is not part of the original 1.0.9 distribution, this was a fix I added in order to display the row information correctly.

ALTER procedure dbo.GetUserDefinedRows
 
@ModuleId int
as
select UserDefinedRows.UserDefinedRowId,
UserDefinedFields.FieldTitle,
'FieldValue' =
Case charindex('http:', UserDefinedData.FieldValue)
When 0 Then
Case charindex(
'@', UserDefinedData.FieldValue)
When 0 Then
UserDefinedData.FieldValue
Else
'' + UserDefinedData.FieldValue + ''
End
Else
'' + UserDefinedData.FieldValue + ''
End
from UserDefinedRows
left outer join UserDefinedData on UserDefinedRows.UserDefinedRowId = UserDefinedData.UserDefinedRowId
inner join UserDefinedFields on UserDefinedData.UserDefinedFieldId = UserDefinedFields.UserDefinedFieldId
where UserDefinedRows.ModuleId = @ModuleId
Order by UserDefinedData.UserDefinedRowId

 

Best DotNetNuke Hosting Recommendation

ASPHostPortal.com
ASPHostPortal.com provides its customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. ASPHostPortal.com offers DotNetNuke hosting starts from $5/month only. We also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable DotNetNuke Hosting, we should be your best choice.