I am writing a template in drupale.
In the code:

$d=count($_items); $e=$d*127;//Значение валидно, проверял $aa.="<div id=\"items-related-products\" class=\"items\" style=\"width: ".$e."px\">"; 

output is obtained

 <div id="items-related-products" class="items" style="width: 0px;"> 

    3 answers 3

    And if so

     $d=count($_items); $e=$d*127;//Значение валидно, проверял $aa.="<div id=\"items-related-products\" class=\"items\" style=\"width: ".strval($e)."px\">"; 
    • Yes, yes, yes: $ aa. = "<Div id = \" items-related-products \ "class = \" items \ "style = \" width: 1895px \ ">"; And so: $ aa. = "<Div id = \" items-related-products \ "class = \" items \ ">"; The problem is that somewhere and somehow Drupal assigns its own value: ( - zenith
    • one
      To check this, give the variables other names. - Zowie
    • I also tried it. These variables do not appear anywhere else. - zenith

    Are you sure you see the output of this particular code block? So let's say I am straining the semicolon after the px in the output. It is missing from the source code. And if this is not a typo when copying to this site, then the most likely reason is that you are analyzing the wrong code branch.

    In such cases, the error_log function helps a lot:

     error_log(var_export($e, true)); 
    • The fact that this is the right branch of the code is sure, since this class is not assigned to any other tags. Tchkzpt is substituted at some stage by a drupal. And just can not track where and how. It appeared in the log: [Thu May 17 11:10:01 2012] [error] [client 127.0.0.3] 1905, referer: localsite Honestly I can not understand what this is for. - zenith

    It was decided easier and more stupid. By analogy with the @AlexWindHope advice, I started changing the name of classes and id. I found my own script with such garbage:

      jQuery("#items-related-products").width(totalWidthRelated); 

    Closed.