Hi,

This is the HTML page I am migrating over to Drupal, -removed-
There is a Javascript expand menu next to "eligible countries" that displays an image when expanded.

This is my Drupal page -removed-
Obviously the expand menu is not working here.

/*
I think the Javascript is being called correctly, I put it directly into page.tpl.php (without the external link) just to make sure and I got the same results.

The problem may be that

initiate(); // This must be placed immediately after the menu in order to format it properly.

has to be placed within the content, and the input format is full HTML.
*/

I am more than willing to remove the Javascript and replace it with a different type of code if I can get the same results. Any suggestions on fixing this or doing it a different way?

Thanks!
Jessica

Comments

PinkChocobo’s picture

I now use the theme fieldsets. It's unclear which way is correct way to do it within the content. I found 2 solutions, one works in D5 and one works in D6, but others claim the other way around works for them. Be careful with using javascript or other things like links that include ", ', (, ) within the fieldsets, you may have to escape them. Try using something simple first that you know will work.

D5:
add this to the body of your content

function createFieldset($title, $body){
    $fieldsetarray = array(
     '#title' => $title,
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
     '#value' => $body);
return $fieldsetarray;
}

and then

<?
print theme('fieldset', createFieldset("TITLE OF FIELDSET", "HTML CONTENT OF FIELDSET"));
?>

D6:
add this to the body of your content

drupal_add_js('misc/collapse.js');
drupal_add_js('misc/drupal.js');

and then

<fieldset class="collapsible collapsed">
<legend>TITLE OF FIELDSET</legend>
HTML CONTENT OF FIELDSET
</fieldset>

Jessica