[eluser]ppwalks[/eluser]
right i will post my code for you to look at:
if you use the index to swap files you can do it like this:
index.php - all views are in sub folder "main"
Code:
<?php $this->load->view('main/header'); ?>
<div id="main-page">
<?php $this->load->view("main/".$main); ?>
</div>
<br />
</div>
<?php $this->load->view('main/footer'); ?>
So as I load the view say products my controller still loads the 960 wide view but I have split it as you would with html treat them indepentantly so my products page I simply call another view within the view.
so here is my products view
Code:
<ul id="venus-stone-products">
<li class="menu_sidebar">
<?php $this->load->view('main/main_sidebar'); ?>
</li>
<li class="all_products">
<h1 class="products-h1">All Products</h1>
<ul id="all-product-view">
<?php
if (count($products) > 0){
foreach ($products as $key => $product){
echo "<li class=\"product\"> \n";
echo "<ul>";
echo "<li class=\"left\">\n";
echo "<img src=' ".base_url() .$product[' alt='".$product[' title='".$product['/><br /> \n";
echo "<h2>".$product['name']."</h2>\n";
echo "<span class=\"style\"><b>Style/ Colour:</b> " . $product['style'] . "</span><br />\n";
echo "<span class=\"price\">Price: £" . $product['price'] . "</span><br />\n";
echo "</li>\n";
echo "<li class=\"right\">\n";
echo "<h3>Quick Overview</h3>";
echo "<p>" .word_limiter($product['longdesc'], 50). "</p><br />\n";
$moreInfo = array (
'src' => base_url().'images/more-info-btn.png',
'alt' => 'More Product Information',
'class' => 'more-info-btn',
);
echo anchor('paving_stone/' . $product['id'] , img($moreInfo), array('title' => $product['name'], 'class'=>'more-info' ))."\n";
?>
<br />
<?php
$addCart = array (
'src' => base_url().'images/add-to-cart-btn.png',
'alt' => 'Add Product to Shopping Cart',
'class' => 'shopping-cart',
);
echo anchor('cart/'.$product['id'],img($addCart), array('alt' => 'Add To Cart', 'class'=>'add-to-cart'));
echo "</li>\n";
echo "</ul>\n";
echo "</li>\n";
}
} else {
echo "<p class=\"no-records\">No Records found</p>";
}
?>
</ul>
<div id="pagin">
<?php echo $this->pagination->create_links(); ?>
</div>
</li>
</ul>
As you can see i have just loaded the view inside of the curent view
and will only load on that page providing you load the views dynamically like i previously have shown you