Jump to content

[SOLVED] I want an introduction to appear only on the homepage


jeeremie

Recommended Posts

This is my intro.php file:

 

<?php
if (!defined('WEB_ROOT')) {
exit;
}
?>


		<h1>Handmade Dolls <span>for Key-Ring by Ann</span></h1>
		<div class="text">
			<img class="center" src="images/intro.jpg" />
			<big class="center">Welcome to Hailstorm Design!</big>
		</div>
		<!--Intro-->

I would do it using CSS.

Give the header box, your div that contains the image, an id and in your CSS file define all it's attributes.

On every other page, use a different id with different attributes.

 

Example:

index.php

<div id="home" class="text">
<big class="center">Welcome to Hailstorm Design!</big>
</div>

 

allothers.php

<div id="nothome" class="text">
<big class="center">Welcome to Hailstorm Design!</big>
</div>

 

screen.css

#home {
width: 150px;
height: 150px;
background: url("../img/homebg.jpg");
}
#nothome {
width: 150px;
height: 150px;
background: url("../img/nothomebg.jpg");
}

Thanks guy for your support.

 

Unfortunately it isn't working as i want. The thing is I have the categories on the homepage as well. When I select a categorie, it loads the products on the  same page (index.php). But I don't want to have the Intro and the products on the same page. I would be too busy.

 

Here is the index.php:

 

<?php
require_once 'library/config.php';
require_once 'library/category-functions.php';
require_once 'library/product-functions.php';
require_once 'library/cart-functions.php';

$_SESSION['shop_return_url'] = $_SERVER['REQUEST_URI'];

$catId  = (isset($_GET['c']) && $_GET['c'] != '1') ? $_GET['c'] : 0;
$pdId   = (isset($_GET['p']) && $_GET['p'] != '') ? $_GET['p'] : 0;

require_once 'include/header.php';
?>

  <?php require_once 'include/top.php'; ?>

  <?php require_once 'include/leftNav.php'; ?>

        <div id="content">             
         <div class="text">

                                <!--******-->
                                <!--I need to add the intro here!-->
                                <h1>Handmade Dolls <span>for Key-Ring by Ann</span></h1>
                  <div class="text">
                    <img class="center" src="images/intro.jpg" />
                    <big class="center">Welcome to Hailstorm Design!</big>
                 </div>
         <!--Intro-->
                                <!--******-->

            <!-- ... and now the script generating the categories and products related-->
            <?php
            if ($pdId) {
               require_once 'include/productDetail.php';
            } else if ($catId) {
               require_once 'include/productList.php';
            } else {
               require_once 'include/categoryList.php';
            }
            ?> 
         </div>      
      </div>
      <!--/Content-->
   
   

  <?php require_once 'include/rightNav.php'; ?>

  <?php require_once 'include/footer.php'; ?> 

 

I hope this helps.

 

the only reel way i can see this working is using a intro as the index page then and

within the intro add a skip link that points to main website page.

 

example.

 

the user goes to the website the user sees the intro for 10 secounds and redirect to main website

if user press the skip intro button go main website.

ok, I thought about this but my customer really wants the categories on the same page.

 

So I will change the question.

 

I include the intro with this script (someone from another forum gave me this):

<?php
if (basename($_SERVER['PHP_SELF']) == 'index.php')
{
include 'include/categoryList.php';
}		
?>

 

How could I change the next script...

<!--<?php
if ($pdId) {
require_once 'include/productDetail.php';
} else if ($catId) {
require_once 'include/productList.php';
} else {
require_once 'include/categoryList.php';
} 
?>  -->

...to have only the category list on the main page and "product list" and "product detail" on another page.

 

For example, Could I create a page product.php page (with productList.php and productDetail.php on it) and when I select a category on index.php I would be redirected to this page?

 

Do you think it could be possible?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.