HTML Manipulation

  
Hi all,

First question: Is it possible insert custom tags in the <head> of the pages?
Example: <link rel="alternate" hreflang="pt-PT" href="http://www.site.com/pt">
 
Second question: Is it possible manipulate the <html> tag?
Example: <html lang = "pt-PT">
 
Is not possible manipulate these elements by HTTPRequestHandler extension.

Many thanks
Diogo
Hi Diogo,

For the link tag you can have the AddLinkTag in the HttpRequestHandler extension but it doesn't support the hreflang attribute. You can however open the extension and replicate the behavior in another extension to support this use case.

The html tag is not customizable but for the lang I think its valid to use that in the body and that tag you can change using javascript. Something like:

$(document).load(function() {
    $('body').attr('lang', 'pt');
});
Hope this helps.

Cheers,
LGP
Hi Guilherme, thank for your help.
I've been searching and I think modify the body tag by javascript is not good idea, because the search engine do not like this approach.

Many thanks,
Diogo
Diogo -

The best approach is to modify the HTTPRequestHandler extension as needed to support what you want. :(

J.Ja
Hi Justin, thank for your help.
I will change the HTTPRequestHandler extension :)

Tanks,
Diogo