Welcome Guest, Not a member yet? Register   Sign In
problem with display of webpage - main page not proper, all others fine
#1

[eluser]bu[/eluser]
Hello, I am new to CI, and I have the following problem. Here is the [/code]site . This is the site for development.
My site structure is like this:

controllers:
-home; - my main page in which there is a problem with the display. the page seems to "drop down" a bit
-info;
-gallery;
-location;
-contacts.

models:
-calendar_model; - a model for my calendar
-content_model; - a model for the content of every page

views:
-header_view; -here is the menu and the header info and the main picture
-content_view; -the content
-footer_view; -the footer

all the pages use the same views and all except the home page display it correctly. Here is an example code:
My Home controller:

Code:
<?php

class Home extends Controller {

    function Home()
    {
        parent::Controller();            
    }
    
    function index($year = null, $month = null)
    {        
        $this->load->model('Content_model');
        $data = $this->Content_model->nachalo();
        $this->load->model('Calendar_model');
        $data['calendar'] = $this->Calendar_model->generate($year, $month,'home');
        
        $this->load->view('header_view',$data);
        $this->load->library('calendar');
        $this->load->view('home_view',$data);
        $this->load->view('footer_view',$data);
    }
}

This is how i call the css file from my header view:
Code:
<?php echo doctype('xhtml1-trans');
$meta = array(
        array('name' => 'Content-type', 'content' => 'application/html; charset=utf-8', 'type' => 'equiv')
    );?>
<html >
<head>
<?php echo meta($meta);?>
<link rel="stylesheet" type="text/css" href=<?php echo base_url() . "assets/css/def.css"?> media="screen" />
<?php echo link_tag('assets/css/lightbox.css');?>
<?php echo link_tag('assets/js/prototype.js');?>
<title>Самостоятелни стаи "Дъга"</title>

[removed][removed]
[removed][removed]
[removed][removed]

</head>

<body>
    <div id="wrapper">
        <div id="menu">
            &lt;?php echo $menu; ?&gt;            
        </div>
        &lt;!-- end #menu --&gt;
        <div id="header">
            <div id="logo">
                <h1>&lt;?php print($webtitle); ?&gt;</h1>
                <p> &lt;?php print($websubtitle); ?&gt;</p>
            </div>
        </div>
        &lt;!-- end #header --&gt;

Can someone help me with that problem?
#2

[eluser]Georgi Budinov[/eluser]
OK you have a lot of problems in your html
Not sure which one is causing problems for ... I actually couldn't find difference between home page and others, so I don't understand where is the problem -
- after closing body tag you have some div tags and noscript tags.
- you have a link tag in the head pointing to prototype.js ?
- format your script and link tags' src with double quotes
#3

[eluser]bu[/eluser]
The stuff after &lt;/body&gt; tag is not mine. It's added automaticaly after i've put it on the host. The problem exists on my localhost too. So it's not from the added code.
#4

[eluser]WanWizard[/eluser]
What stuff? There is no "&lt;/body&gt;" tag in your posted example...
#5

[eluser]bu[/eluser]
He was talking about the noscript and div code on the real page and this code shouldn't be there. But this is not the real host and domain that the page should be e on... it is just for testing... this is not the point Smile There is a much more deaper and darker secret of why my code doesen't work. Waiting for some black magic to happen...
#6

[eluser]Georgi Budinov[/eluser]
I can't see where exactly is the problem ... some js somewhere . don't know, but see what is happening - Open the home page , open firebug and see what is happening to the link and script tags ... they are moved from the head to body with a white space ( actually in Google Chrome's dev tools there is a '"-"'). I suppose it is js related but can't find he prolem itself having just this info.
#7

[eluser]Georgi Budinov[/eluser]
I am pretty sure you output something before the doctype definition. Check that!
Edit: nevermind ... not that
Show more code.
#8

[eluser]cahva[/eluser]
@Georgi: atleast when I look at the sourcecode, I see ? mark before doctype defeinition:

home:
Code:
?<!DOCTYPE html

info:
Code:
<!DOCTYPE html
#9

[eluser]Georgi Budinov[/eluser]
Well I was pretty sure that the problem is something like this but didn't noticed that in the page source generated from firefox.




Theme © iAndrew 2016 - Forum software by © MyBB