Page 1 of 1

External Link validated with XHTML strict (bulk sql change)

Posted: Tue Aug 04, 2009 4:15 pm
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

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

Posted: Tue Aug 04, 2009 4:21 pm
by nhaack
Nice! Thanks a lot. This will definitely come in handy sooner or later.

Best
Nils