Whitespace added before block item

Permalink
Hello there!
I am facing an interesting problem. I have a custom block item in a scrapbook, being inserted into a page from code automatically. Every one of the block has some un-breaking whitespace in front of them, messing up the design. I have tried to point out the origin of these whitespace-characters, but in vain. Here is the code I have for the blocks view.php:

<div class="_reklam-AM">
<?php
$html=Loader::helper('html');
$picture=$this->controller->getPicture();
?>
<div class="_elso-oszlop">
   <?php echo $szoveg; ?>
</div>
<div class="_masodik-oszlop">
   <?php echo $html->image($picture->getURL()); ?>
</div>
</div>


I also double checked the blocks' html, and found that there are no unwanted <p></p> tags, or whatever -- just plain whitespace charaters in front of each instance of the specific block type. Also, here is the code I use to insert the blocks:

<div id="tartalom_AM"><!-- KIEMELT ANIMÁLT TARTALOM SÁV -->
      <ul>
      <?php
         $scrapbookHelper=Loader::helper('concrete/scrapbook');
         foreach($scrapbookHelper->getAvailableScrapbooks() as $sb){
            $scrapBooks[$sb["arHandle"]] = new Area( $sb["arHandle"] );
            $globalScrapbookC = $scrapbookHelper->getGlobalScrapbookPage();
            $scrapBooks[ $sb["arHandle"]] = $scrapBooks[$sb["arHandle"]]->getAreaBlocksArray( $globalScrapbookC );
         }
         foreach($scrapBooks["tartalom_AM"] as $blocks){
            echo '<li>';
            $bv = new BlockView();
            $bv->render($blocks, "scrapbook");
            echo '</li>';
         }


I also tried putting all code, both HTML and PHP on one line, but it did not help. I have run out of ideas. I welcome any guesses. Thanks!

1 Attachment

 
szucslaszlo replied on at Permalink Reply
When removing all C5 specific code, the problem persisted. It seems, that the browser renders some whitespace in a certain context... strange. I know it is not concrete related anymore, but if anyone has any suggestions, I'd be very happy!
KoWa replied on at Permalink Best Answer Reply
http://www.concrete5.org/community/forums/customizing_c5/is-there-a-bug-in-the-content-block-or-am-i-missing-something/
szucslaszlo replied on at Permalink Reply
Thanks! I would probably never have figured that out on my own!