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...Administration ...Administration ...Bug - Friendly URL with accentsBug - Friendly URL with accents
Previous
 
Next
New Post
9/26/2012 10:19 AM
 
Sorry to bring this old question back, but recently I had the same issue using DNN 6 Community and I wrote some patch that can be used to solve this. Also I think this patch could be applied to the DNN itself.

Follow the steps (scripts were made so you can run from Host/SQL in the Admin interface):

PS: Sorry for the long answer. It is the first time I post in this community.

1. Create a new DB function to clean accents in strings:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'{databaseOwner}{objectQualifier}CleanURLString') AND type in (N'FN'))
BEGIN
CREATE FUNCTION {databaseOwner}{objectQualifier}CleanURLString(
@string nvarchar(max)
)
RETURNS nvarchar(max)
AS
BEGIN
SET @string = LOWER(@string)
SET @string = {databaseOwner}{objectQualifier}RemoveStringCharacters(@string, '&? ./''-#:')
SET @string = Replace( @string COLLATE Latin1_General_CS_AI, 'a', 'a' )
SET @string = Replace( @string COLLATE Latin1_General_CS_AI, 'e', 'e' )
SET @string = Replace( @string COLLATE Latin1_General_CS_AI, 'i', 'i' )
SET @string = Replace( @string COLLATE Latin1_General_CS_AI, 'o', 'o' )
SET @string = Replace( @string COLLATE Latin1_General_CS_AI, 'u', 'u' )
SET @string = Replace( @string COLLATE Latin1_General_CS_AI, 'y', 'y' )
SET @string = Replace( @string COLLATE Latin1_General_CS_AI, 'n', 'n' )
SET @string = Replace( @string COLLATE Latin1_General_CS_AI, 'œ', 'oe' )
SET @string = Replace( @string COLLATE Latin1_General_CS_AI, 'æ', 'ae' )
SET @string = Replace( @string COLLATE Latin1_General_CS_AI, 'ß', 'ss' )
SET @string = Replace( @string COLLATE Latin1_General_CS_AI, 's', 's' )
RETURN @string
END
END
GO

2. Alter the DNN SP that creates Tabs friendly URL to use the new function:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'{databaseOwner}{objectQualifier}BuildTabLevelAndPath') AND type in (N'P'))
BEGIN
ALTER PROCEDURE {databaseOwner}{objectQualifier}BuildTabLevelAndPath(@TabId INT, @IncludeChild BIT = 0)
AS
BEGIN
DECLARE @ParentId INT, @Level INT, @TabPath NVARCHAR(255), @TabName NVARCHAR(50)
SELECT @ParentId = ParentId, @TabName = TabName FROM {databaseOwner}{objectQualifier}Tabs WHERE TabID = @TabId
IF @ParentId > 0
BEGIN
SELECT
@Level = [Level] + 1,
@TabPath = TabPath + '//' + {databaseOwner}{objectQualifier}CleanURLString(@TabName)
FROM {databaseOwner}{objectQualifier}Tabs WHERE TabID = @ParentId
END
ELSE
BEGIN
SELECT @Level = 0, @TabPath = '//' + {databaseOwner}{objectQualifier}CleanURLString(@TabName)
END

UPDATE {databaseOwner}{objectQualifier}Tabs SET [Level] = @Level, TabPath = @TabPath WHERE TabID = @TabId

IF @IncludeChild = 1
BEGIN
DECLARE @ChildTabs TABLE(TabID INT)
DECLARE @ChildID INT
INSERT INTO @ChildTabs SELECT TabID FROM {databaseOwner}{objectQualifier}Tabs WHERE ParentId = @TabId
WHILE EXISTS (SELECT TOP 1 TabID FROM @ChildTabs)
BEGIN
SET @ChildID = (SELECT TOP 1 TabID FROM @ChildTabs)
EXEC {databaseOwner}{objectQualifier}BuildTabLevelAndPath @ChildID, @IncludeChild
DELETE FROM @ChildTabs WHERE TabID = @ChildID
END
END
END
END
GO

This will work for new/edited tabs. But to apply the fix to existing tabs, run this:

3. Re-create the TabPath for existing tabs:
DECLARE m CURSOR FOR SELECT TabID FROM {databaseOwner}{objectQualifier}Tabs
OPEN m
DECLARE @tabid int
FETCH NEXT FROM m INTO @tabid
WHILE (@@FETCH_STATUS <> -1)
BEGIN
IF (@@FETCH_STATUS <> -2)
EXEC {databaseOwner}{objectQualifier}BuildTabLevelAndPath @tabid, 0
FETCH NEXT FROM m INTO @tabid
END
CLOSE m
DEALLOCATE m
GO
 
New Post
9/26/2012 11:57 AM
 
nice, but how do you deal with Hebrew, Arab and Chinese characters? Besides, newer browsers support URLs containing special characters.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
9/26/2012 12:16 PM
 
Current browsers do support accented characters but they look ugly if you copy and past (something that my users do a lot). I know it's not a real problem, but my users were complaining about this.

The function to clean URL can be extended to replace/remove any character needed, we may just need a complete list of undesired characters. Maybe there could exist some options in the Host Settings, in same place where you setup URL Rewrite to activate accents clean up in urls or as most CMS, in the page settings, the TabPath field could be exposed so the user can type any url he wants.
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Bug - Friendly URL with accentsBug - Friendly URL with accents


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