Hi guys, thanks for all your help with this. I have come up with a solution which doesn't involve any GET or POST statements (yay :D) And it's half working, but I'm pretty sure I have done something wrong as I am not a coder and have just tried different things. I installed the mod 'product extra fields' to give each of my products an extra field on the product page with a link to the article in the advice centre it corresponds with. I have pinched some of the code from that mod and entered it into the 'editable sidebox' mod, to show the link in the sidebox instead of the product page. However, I am pretty sure the code shouldn't just be copied as the code is different between template files and sidebox files, so it is not behaving how I want. This is the code I entered into my includes/modules/sideboxes/editable_sidebox.php file: ```php
<?php
/**
* editable sidebox - allows an admin-editable sidebox to be added to your site
*
* @package templateSystem
* @copyright 2007 Kuroi Web Design
* @copyright Portions Copyright 2003-2007 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
*
@version $Id: blank_sidebox.php 2007-08-10 kuroi $
*/
// test if box should display
$show_editable_sidebox = true;
if (in_array($current_page_base,explode(",",'faqs_all')) ) {
$show_editable_sidebox = false;
}
if (in_array($current_page_base,explode(",",'faq_info')) ) {
$show_editable_sidebox = false;
}
$define_sidebox = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', DEFINE_EDITABLE_SIDEBOX_NAME, 'false');
if ($show_editable_sidebox == true) {
require($template->get_template_dir('tpl_editable_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_editable_sidebox.php');
$title = BOX_HEADING_EDITABLE_SIDEBOX;
$title_link = false;
$sql = "select * from " . TABLE_PRODUCT_EXTRA_FIELDS . "
where products_id = '" . (int)$_GET['products_id'] . "'";
$files = $db->Execute($sql);
/*
* extract info from queries for use as template-variables:
*/
$extra_field = $files->fields['extra_field'];
$products_file_1_title = $files->fields['file_1_title'];
$products_file_2_title = $files->fields['file_2_title'];
$products_file_3_title = $files->fields['file_3_title'];
$products_file_4_title = $files->fields['file_4_title'];
$products_file_1 = $files->fields['file_1'];
$products_file_2 = $files->fields['file_2'];
$products_file_3 = $files->fields['file_3'];
$products_file_4 = $files->fields['file_4'];
$products_video = $files->fields['video'];
$products_video_title = $files->fields['video_title'];
if (!empty($products_video)) $products_video_link = '<a href="javascript:popupWindow(\''.zen_href_link(FILENAME_FLASH).'&id='.$_GET[products_id]. '\') ">'. $products_video_title . '</a>';
if (!empty($products_file_1_title)) $products_file_1_link = '<a href="' . "product_extra_files/" . $products_file_1 . '">'. $products_file_1_title . '</a>';
if (!empty($products_file_2_title)) $products_file_2_link = '<a href="' . "product_extra_files/" . $products_file_2 . '">'. $products_file_2_title . '</a>';
if (!empty($products_file_3_title)) $products_file_3_link = '<a href="' . "product_extra_files/" . $products_file_3 . '">'. $products_file_3_title . '</a>';
if (!empty($products_file_4_title)) $products_file_4_link = '<a href="' . "product_extra_files/" . $products_file_4 . '">'. $products_file_4_title . '</a>';
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
?>
It should be bolded and red. Then this is the code I entered into my includes/templates/my_template/sideboxes/tpl_editable_sidebox.php file: php
<?php
/**
* editable sidebox - allows a sidebox editable with the define pages editor to be added to your site
*
* @package templateSystem
* @copyright 2007 Kuroi Web Design
* @copyright Portions Copyright 2003-2007 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
*
@version $Id: blank_sidebox.php 2007-08-10 kuroi $
*/
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
$content = file_get_contents($define_sidebox);
// this is where the content that you have via the Admin is pulled in.
$content .= '</div>';
?>
'<div class="adlink"><?php if($extra_field!='') {
echo '<li>'.$extra_field . '</li>';
} ?></div>'