Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • mfeola 117 posts 221 karma points
    Nov 01, 2010 @ 19:49
    mfeola
    0

    They put tags in the nodeName, how do i remove that?

    So it looks like i have to go in and remove tags from node names of already existing pages.  it basically looks like this in the name field

    Roundtable on Instillation <font Color="#FF0000">(uncut)</font>

    so i just want to remove the tags from the url.  is there any way to do that quickly with the umbracoSettings.config? is there any way to do this easily and quickly in general?

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Nov 01, 2010 @ 19:56
    Sebastiaan Janssen
    0

    The short answer: No.

    The long answer: HTML parsing and cleaning is very very hard! The best thing you can do now (if you don't want to clean by hand) is write something like a usercontrol that goes through all of your nodes and uses something like umbraco.library.StripHtml to remove tags from the title. I don't think there's a way to prevent your editors from just inserting them again though. An afterSave handler would need to take care of this (doing StripHtml again).

  • mfeola 117 posts 221 karma points
    Nov 01, 2010 @ 20:21
    mfeola
    0

    there wouldnt happen to be a database call i can make to locate the offending names would there be?

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Nov 01, 2010 @ 20:45
    Sebastiaan Janssen
    0

    Good one! You might be able to clean up the umbracoNode table. Don't forget to go to the content section, right click on the top Content node and choose "Republish all".

  • mfeola 117 posts 221 karma points
    Nov 01, 2010 @ 21:37
    mfeola
    1

    im close... i was able to remove it from the text column in that table... but the links still have the font tags when i save and publish even when the text of the link does not.  and the name field also still has the font tags... guess i have to find another table to remove it from.  anyway here is the function that i used for future reference

    CREATE FUNCTION dbo.tagstrip ( @in VARCHAR(8000)  )
    RETURNS VARCHAR(8000) AS BEGIN
    DECLARE @i INT
    WHILE 1 = 1 BEGIN
    SET @i = LEN( @in )
    SET @in = REPLACE( @in, SUBSTRING( @in,
    CHARINDEX( '<', @in ),
    CHARINDEX( '>', @in ) -
    CHARINDEX( '<', @in ) + 1 ), SPACE( 0 ) )
    IF @i = LEN( @in ) BREAK END
    RETURN (  @in )
    END

    EDIT: I also did it to the text column in the CMSDocument table.  I had to republish the pages afterwards but i think that worked.  

Please Sign in or register to post replies

Write your reply to:

Draft