a category
a category
Then you would probably want to add the snippet to /includes/templates/your_template/templates/tpl_index_categories.php near the bottom:Code:<?php $show_display_category->MoveNext(); } // !EOF ?> <?php if ($current_category_id == 34) {//replace 34 with your category id echo '<div class="advert">' . ADVERT_1 . '</div>'; } ?> </div>
thanks, i'll give it a try first thing tomorrow
perhaps I did something wrong but when i edited the first file and added the second file my site disapeared completely. I put it back and the site came back. ???
Yes, obviously you made some PHP error. We can't tell what it was without seeing exactly what you did, though. Can you copy & paste the area for a few lines around the edited file section?
under /includes/languages/english/extra_definitions I added a file
advert_defines.php and this is the copy
<?php
define('ADVERT_1','<table width="100%" border="1" bgcolor="#99d1d1" style="color: #000000">
<tr>
<td align="center"></td>
</tr></table>
<tr><td>
DVR Recorders<br />Are you looking for the best and most reliable <a
href="http://direct.tesco.com/q/N.2001329/Nr.99.aspx"
target="_blank"><b>DVD recorders</a></b>? Here at Airtight Security Plus, you will find a wide array of selection for you. You get the freedom to choose from these great items. All the items featured in this page are made with the highest quality thus ensuring customer satisfaction. Make sure to read the complete details and specifications of the items so that you'll be able to choose the best one.
Digital Video Recorders are the new age video recording system. With internet ready recorders, motion sensing recording, and lengthy recording times, you can view the output live anywhere in the world with the internet
');
?>
and under includes/templates/template_default/templates (I also tried this under includes/templates/my_own_template/templates and includes/templates/bask_black/templates) I added the following
<?php
/**
* display the New Products Center Box
*/
?>
<?php require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.php'); ?>
<?php } ?>
<?php
if ($current_category_id == 13) {//replace 34 with your category id
echo '<div class="advert">' . ADVERT_1 . '</div>';
} ?>
<?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_UPCOMING') { ?>
<?php include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS)); ?><?php } ?>
<?php
$show_display_category->MoveNext();
} // !EOF
?>
</div>
using current_category_id == 13
the file existed under template_default but I had to copy and paste the file to the other 2 locations when I tried it there cause it was not already under those (my_own_template and bask_black)
I don't see any stray single quotes in your define (which would cause an error), but I do notice bad HTML: You open a table, then close it, then open <tr> and <td>, then give your content, and don't even close the table row or cell let alone the nonexistent table. That needs to be fixed, though it doesn't seem likely that it could wipe out your whole page.
Have you tried putting just the define file in place? If that causes a problem, the source is narrowed down.
Any file you edit should be copied from /template_default/ into the same /your_template/ folder structure, then edited. Never change the /template_default/ version.
alright I did find a mistake I made... I added the file to
includes/templates/my_own_template/templates
and was supposed to add it to
includes/templates/my_own_template
I have fixed that and the page does not disappear now but I see no change or text, I will see if I can work on the html
site keeps disappearing when I do any of this
What file did you add to /includes/templates/my_own_template/ ?
There are no files you would be working with that would go there; they would go in /my_own_template/templates/ or /my_own_template/common/ or another subfolder, assuming they belong under /includes/templates/ at all and not under /includes/modules/ or /includes/languages/, etc.