By Ex-user on
Alexandria a multilingual dictionary that I integrated in a phpbb forum a few months ago and I would like to do the same thing now that I moved to Drupal. This is a Javascript code (available here : http://www.memodata.com/2004/en/alexandria/install.shtml). In phpbb I just had to paste it in the Overall_header file of Subsilver to activate the dictionary. Where should I paste the Javascrip lines in Drupal ?
Any suggestion?
Alain
Comments
Should it be on every page?
If it is something you want on every page, the header in the theme would be fine for Drupal, as well.
If it displays something then a block would be the right place, which you can do through the block administration UI.
If you want to insert the JS programmatically use:
function drupal_set_html_head($data = NULL) {
from common.inc.
- Robert Douglass
-----
Rate the value of this post: http://rate.affero.net/robertDouglass/
I recommend CivicSpace: www.civicspacelabs.org
My sites: www.hornroller.com, www.robshouse.net
Thank you for your help
It's a pop-up dictionary. When you double-click on a word in a forum or a blog, etc., the dictionary appears.
(To see it just go to my blog, www.quebec-japon.com/blogs) and double-click on any word in the text.)
I would like to apply it on every page. I tried to find the header file of the theme, but I don't find it. I have no idea how I can do it programmatically, so I would like to paste the line in a file...
Kind regards,
Alain
What version of Drupal and what theme?
In requests like this you need to indicate what version of Drupal you use and what theme.
If it is a PHPTemplate theme, you will have a file calle page.tpl.php in your theme directory /themes/yourtheme
That is where you can post the code.
- Robert Douglass
-----
Rate the value of this post: http://rate.affero.net/robertDouglass/
I recommend CivicSpace: www.civicspacelabs.org
My sites: www.hornroller.com, www.robshouse.net
Version and theme
Thanks. It's Dupal 4.6 and the theme is bluemarine. I tried to find a file to paste my Javascript lines, but I'm lost. :-( I don't mind using another theme if it solves my problem. Any suggestion ?
Alain
Paste it into your footer
I went to your site, copied the JS from your page source, and then copied it into the footer of my site and it worked perfectly.
By the footer, I mean the one you can define from the page administer->settings->General settings->Footer message.
- Robert Douglass
-----
Rate the value of this post: http://rate.affero.net/robertDouglass/
I recommend CivicSpace: www.civicspacelabs.org
My sites: www.hornroller.com, www.robshouse.net
It works !!!
Thank you very much !!! We are a site of translators and we use this dictionary quite a lot !
I really apreciate your help !
Alain