You are here:  » Adding Index content

Support Forum



Adding Index content

Submitted by stewartrose on Thu, 2008-02-28 09:40 in

Good Morning Team,

I created a file called /html/user_header_after.php add if I put data in that file it shows up on every page.
Is there a way to make it only show up on the index page please...

All the best from Alan

Submitted by support on Thu, 2008-02-28 11:20

Hello Alan,

There are 2 things you can do.

One is to just edit index.php and insert your content in there. For plain HTML, you will have to come out of PHP mode, and then return to PHP mode afterwards, for example:

?>
  ... YOUR HTML HERE ...
<?php

Alternatively, to keep the Price Tapestry files unchanged, and just edit html/user_header_after.php, you can do it like this:

<?php
switch($_SERVER["PHP_SELF"])
{
case "/index.php":
?>
  ... YOUR INDEX PAGE HTML HERE ...
<?php
}
?>

Hope this helps!
Cheers,
David.

Submitted by stewartrose on Thu, 2008-02-28 14:31

Hi David,

Some sneaky bit of code, I will make good use of that thank you.

One last point and I dont know if it is possible
I have noticed some products have pictures missing.
is there any way to remove the product from the feed, or at best put a dummy picture in...

Thanks in advance

All the best from Alan

Submitted by support on Thu, 2008-02-28 16:22

Hello Alan,

You could make the Image URL a required field during import. This would have the effect of removing any products that do not have an image (if this is really what you want to do). To make that change, in includes/admin.php look for the following code around line 155:

    /* check product record for minimum required fields */
    if (!$record[$admin_importFeed["field_name"]] || !$record[$admin_importFeed["field_buy_url"]] || !$record[$admin_importFeed["field_price"]]) return;

...and change this to:

    /* check product record for minimum required fields */
    if (!$record[$admin_importFeed["field_name"]] || !$record[$admin_importFeed["field_buy_url"]] || !$record[$admin_importFeed["field_price"]] || !$record[$admin_importFeed["field_image_url"]] ) return;

Alternatively, yes you can make it use a default image if there is no image for a particular product. The changes for both the main product page and search results are in this thread:

http://www.pricetapestry.com/node/472

Hope this helps!
Cheers,
David.