By alcaky5 on
Hi,
I have added the following code to one of my Drupal content pages which I received from Website Translator - Google Translate:
function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL}, 'google_translate_element'); }It works great but I have a question.
I add the code by changing the Text format to Plain Text and insert the code. I then publish the page and the Google Translate button is active on my Drupal page, and works great. The issue I am having is, if I edit the page and switch the Text format from Plain Text to Full HTML the code I inserted is lost. Why is that happening?
Thanks in advance for your help
Comments
=-=
per: https://www.drupal.org/node/643758 please edit the opening post and move it to the 'post installation' forum. Thank you.
Full HTML format will reject
Full HTML format will reject any tags that aren't in the text format's allowed tags list. You can edit that to accept script elements, but you probably shouldn't, if you accept content from users. That would be a security risk.
You may be happier putting the GT code into a block and adding the block at the bottom of the Main Content block, or wherever - that way you could set its body to a non-filtered format and not worry about having to accommodate other content.
============================
Resonetrics: Better Tools for Building Brands
http://resonetrics.com
http://technologyformarketers.com
http://kittenassociates.org
http://www.linkedin.com/in/sammooreatresonetrics