External Link validated with XHTML strict (bulk sql change)

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
User avatar
blast2007
Power Poster
Power Poster
Posts: 508
Joined: Wed Aug 01, 2007 5:36 pm

External Link validated with XHTML strict (bulk sql change)

Post by blast2007 »

I found in wiki this UDT but I think it's not easy to remember (also for average users) its syntax. So, following this thread relative to "External links in new window & XHTML Strict compliant" I was looking for an automation to change all external links from  target ="_blank" to class="external".
This post was very interesting, because using a class for an external link, is very easy and fast also in TinyMCE (you can select "external" style in dropdown window style property).

Changing this attribute, all external links are validated XHTML Strict without manually changing all links in my pages.

Here following SQL statement used for this task:

Code: Select all

UPDATE `cms_content_props` SET `content` = REPLACE(`content`,"target="_blank"","class="external"") where `prop_name` = "content_en"
Here some little improvements applied to the original script:
{literal}



{/literal}
Hope it helps

regards
blast
Last edited by blast2007 on Tue Aug 04, 2009 4:28 pm, edited 1 time in total.
nhaack

Re: External Link validated with XHTML strict (bulk sql change)

Post by nhaack »

Nice! Thanks a lot. This will definitely come in handy sooner or later.

Best
Nils
Post Reply

Return to “Tips and Tricks”