HI
I have an ec-live-subproduct product with a lot of subproduct variations and attributes applied to it.
When you navigate to the product node a would like my attributes to be in collapsible fields of the respective variations to save space on page [and to be swish]
I see the function > theme_ec_live_subproducts_pproduct_view is called to display the attributes at the node view.
Where could i enter code to enable the fieldsets?

thanks

Comments

brmassa’s picture

Assigned: Unassigned » brmassa
Category: feature » support
Priority: Critical » Minor
Status: Active » Fixed

anon,

there is a line in theme_subproducts_pproduct_view()

$output = theme('fieldset', array('#children' => $output));

change it to

$output = theme('fieldset', array('#children' => $output, '#collapsable' => true, '#collapsed' => true));

regards,

massa

.-_-.’s picture

Status: Fixed » Postponed (maintainer needs more info)

i thought that was it too and tried it before this post but it doesn't seem to work for me.
i see it uses druapl 5 form api and that line is where the array is and where the values should go but it just didnt work for me

i got it to work in IE but not FF with the old technique of encapsualting with and .

function theme_ec_live_subproducts_pproduct_view(&$form) {
  $output = "";
  drupal_add_js(drupal_get_path("module", "ec_live_subproducts") ."/ec_live_subproducts.js");
  drupal_add_css(drupal_get_path("module", "ec_live_subproducts") ."/ec_live_subproducts.css");
  foreach (element_children($form["variations"]) as $i) {
    $output .= "<div class='variation'><fieldset class='collapsible'><legend>". drupal_render($form["title"][$i]) ."</legend>" ;
    if (!empty($form["vardesc"][$i]["#value"])) {
      $output .= "<div class='vardesc'>". check_markup(drupal_render($form["vardesc"][$i]), $attribute2["format"]) ."</div>" ;
    }
    $output .= "<table><tr>";
    $output .= "<td class='description' id='description-". $i ."' ><p>". drupal_render($form["description"][$i]) ."</td>";
    $output .= "<td>". drupal_render($form["variations"][$i]) ."</td></tr></table></div>";
    unset($form["image"][$i]);
  }
  
  $output .= drupal_render($form);
  $output .= "</fieldset>";
  $output = theme("fieldset", array("#children" => $output));
  $output .= "<script type='text/javascript' src='/5store/misc/collapse.js'></script>";
  return $output;
} // theme_ec_live_subproducts_pproduct_view

did you try the way you suggested above?
this way seems to work but not in FF so need to figure it out

thank you

.-_-.’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

closing

webfaqtory’s picture

Just in case someone copies the example above as I did. #collapsable is wrong! Should be #collapsible ie:

<?php
$output = theme('fieldset', array('#children' => $output, '#collapsible' => true, '#collapsed' => true));
?>

It also helps to have a title and possibly weight.

<?php
$output = theme('fieldset', array('#children' => $output, '#collapsible' => true, '#collapsed' => true, '#title' => 'MyFieldset', '#weight' => 1));
?>