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:
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:
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!
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:
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>'; }
Viewing 15 lines of 18 lines. View entire code block.
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!
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!
http://www.concrete5.org/community/forums/customizing_c5/is-there-a-bug-in-the-content-block-or-am-i-missing-something/
Thanks! I would probably never have figured that out on my own!