Welcome Guest, Not a member yet? Register   Sign In
Blank Spaces appears - please help!
#1

[eluser]Bart Majewski[/eluser]
Hello everybody!

I am just finishing my project, and everything was fine till I was send HTML with CSS to put into my CMS.

I have created sth like masterpages - so I am sending to one view data with names of other views. So in my Views folder I have:

[views]
- [pages]
- home.php
- about.php
- contact.php .. etc.
- template.php
- menu.php
- header.php
- footer.php

my template.php looks like that:
Code:
<?php
    $site =  $this->load->view('site/header', $site_data);
    $site .= $this->load->view('site/menu', $menu_data);
        $site .= $this->load->view('site/'.$main_content, $site_data);
        $site .= $this->load->view('site/footer');

I am using UTF-8 coding, and in my site, wierd blank spaces are appearing:
Site screen shoot #1

The same thing happens in FireBug:
FireBug screen shoot #2


Another very wierd thing is, that my header.php view looks like that:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&lt;html &gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;meta name="description" content="Nasza oferta to hale stalowe, projekty hal i budowa hal. Budujemy konstrukcje stalowe, hale produkcyjne, hale magazynowe, hale sportowe, hale wystawowe, hale przemysłowe, salony samochodowe, wiaty, magazyny, hangary i inne hale stalowe" /&gt;
&lt;meta name="keywords" content="hale, hale stalowe, konstrukcje stalowe, budowa hal, projekty hal, hale przemysłowe, lekkie hale stalowe, hale sportowe, salony samochodowe, hale produkcyjne, hale magazynowe, magazyny, hangary, wiaty, montaż konstrukcji, spawanie blachownic, Polonex, Stelco" /&gt;
&lt;meta http-equiv="Content-Language" content="pl" /&gt;
&lt;meta name="robots" content="all" /&gt;
&lt;meta name="title" content="hale stalowe, projekty hal, budowa hal, konstrukcje stalowe" /&gt;
&lt;meta name="Googlebot" content="noodp" /&gt;
&lt;title&gt;Hale stalowe Polonex. Budowa hal, konstrukcje stalowe, projekty hal&lt;/title&gt;
&lt;link href="&lt;?php echo base_url(); ?&gt;style.css" rel="stylesheet" type="text/css" /&gt;
&lt;link rel="stylesheet" type="text/css" href="&lt;?php echo base_url(); ?&gt;css/superfish.css" media="screen"/&gt;
[removed][removed]
[removed][removed]
[removed][removed]
[removed][removed]
[removed]
        // initialise plugins
        jQuery(function(){
            jQuery('ul.sf-menu').superfish();
        });
        [removed]

&lt;/head&gt;
&lt;body class="twoColFixRtHdr"&gt;
<div class="hide">
</div>
<div id="container">
  <div id="header"><div class="logo">
&lt;?php
                $banner[]     = "";
                $i             =    0;
?&gt;
&lt;?php if(isset($site_data['banner'])) : foreach($site_data['banner'] as $banner_info) : ?&gt;
&lt;?php
                $banner[$i] = $banner_info->value;
                $i++;
?&gt;            
&lt;?php endforeach; ?&gt;
&lt;?php else : ?&gt;
<h2>Brak danych!</h2>
&lt;?php endif; ?&gt;
<h1>&lt;?php echo $banner[0]; ?&gt;</h1>
<h2>&lt;?php echo $banner[1]; ?&gt;</h2></div></div>

and CI is putting all those links and scripts
Code:
&lt;link href="&lt;?php echo base_url(); ?&gt;style.css" rel="stylesheet" type="text/css" /&gt;
&lt;link rel="stylesheet" type="text/css" href="&lt;?php echo base_url(); ?&gt;css/superfish.css" media="screen"/&gt;
[removed][removed]
[removed][removed]
[removed][removed]
[removed][removed]

into &lt;body&gt; tag (img hereSmile
FireBug screen shoot #3

(SUPPOSED TO BE SCRIPT TYPE="TEXT/JAVASCRIPT" LINKS WHERE APPEARS [REMOVED] IN CODE VIEW ABOVE!)

Does anybody knows what is going on?

I am using open php tags everywhere! I have read some posts about blank spaces (like this one Blank space problem , trying to change encoding, nothing was changed. But when I change encoding in my browser from UTF-8 to for example Windows-1251, I am getting strange characters (please look at another website screen shoot HERE

Please, please for help. My deadline is comming, I have to submit my project!

So I would be very gratefull for any help!!!
#2

[eluser]imn.codeartist[/eluser]
what IDE did you use to program the code ?
#3

[eluser]Bart Majewski[/eluser]
I am using Dreamwaver CS4 for this project.
#4

[eluser]Bart Majewski[/eluser]
Ok, thank you dixcoder, you made my day!
I have NetBeans 6 and opened all my files in it. It turns out, that this was encoding issue. DW was putting a signs like ' - ' at the first line in every file, and in DW it was invisible.

Sorry for the mess here! Wasn't any CI bug, my bad tho.

Cheers,

BM
#5

[eluser]khagendra[/eluser]
Code:
$site =  $this->load->view('site/header', $site_data);
    $site .= $this->load->view('site/menu', $menu_data);
        $site .= $this->load->view('site/'.$main_content, $site_data);
        $site .= $this->load->view('site/footer');

Here in your code You are trying to returning the view as a string. But, i think, you have forgotton to use the third patameter i.e. true. here is the example


Code:
$string = $this->load->view('viewName', '', true);

so try like this
Code:
$site =  $this->load->view('site/header', $site_data, true);

it will work
#6

[eluser]Bart Majewski[/eluser]
Thank you! It works!




Theme © iAndrew 2016 - Forum software by © MyBB