Zen Cart Logo
Forums / Addon Sideboxes / Adding a URL to Custom Sidebox Headings

Adding a URL to Custom Sidebox Headings

Locked

Views: 1,167

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
2 Apr 2009, 1:04 PM
#1
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Adding a URL to Custom Sidebox Headings

Hi All,

I have a bunch of custom sideboxes that become active when a parent category is entered. They pop up and display size categories.

[Example link to site is here.

](http://www.limelites.co.uk/index.php?main_page=index&cPath=1_254)I have been trying to add URLs to each of these boxes which direct the user back to their parent category. I tried doing it like this:

define('BOX_HEADING_TROUSERS_SIZES_SIDEBOX', '<a href="/index.php?main_page=index&cPath=1_5"> Trousers');

.......and I was sure it was working well until I noticed that this isn't only adding the URL to the title text in the header of each box, but it's also adding the same URL to the whitespace, i.e., the background of the sidebox contents.

This is no use to me as it makes it too ambiguous as to whether you're clicking the text links, or the background.

Can anyone tell me how I should have added the URL to the title text as my method is obviously wrong :blush::oops::blush:

I'm sure this will be simple to any of you guys, I'm still getting to grips with php.

4 Apr 2009, 9:26 PM
#2
s_t_e_v_e avatar

s_t_e_v_e

Zen Follower

Join Date:
Aug 2006
Location:
UK
Posts:
430
Plugin Contributions:
0

Re: Adding a URL to Custom Sidebox Headings

eek! I've just looked at your page source... You have some quite poor structure to the page, for exampe;

<!--// bof: trouserssizessidebox //-->
<div class="leftBoxContainer" id="trouserssizessidebox" style="width: 170px">
<h3 class="leftBoxHeading" id="trouserssizessideboxHeading"><a href="/index.php?main_page=index&cPath=1_5"> Trousers</h3>
<div id="trouserssizessideboxContent" class="sideBoxContent"><h1><html>

<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>TROUSERS</title>
</head>
<body>

This can cause some "random" display problems with different browsers... in this case, that is why the whole background of your trouser sidebox is clickable in IE...

http://validator.w3.org/check?verbose=1&uri=http://www.limelites.co.uk/index.php?main_page=index&cPath=1_5

4 Apr 2009, 9:31 PM
#3
s_t_e_v_e avatar

s_t_e_v_e

Zen Follower

Join Date:
Aug 2006
Location:
UK
Posts:
430
Plugin Contributions:
0

Re: Adding a URL to Custom Sidebox Headings

You have probably added some extra html, head, meta, and body tags to your custom sideboxes...

5 Apr 2009, 7:37 AM
#4
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Adding a URL to Custom Sidebox Headings

Hi Steve,

I took a look at my custom sidebox and removed the html,head and body tags from one to test it. It didn't seem to make any difference.

Here is the content of the dress_sizes_sidebox_defines.php file after I removed the tags. Maybe you can see straight away what's causing the naughtiness:

<?php
/**
 * blank sidebox definitions - text for inclusion in a new blank sidebox
 *
 * @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-05-26 kuroi $
 */

define('BOX_HEADING_DRESS_SIZES_SIDEBOX', '<a href="/index.php?main_page=index&cPath=1_6"> Dresses');
define('TEXT_DRESS_SIZES_SIDEBOX', '<div align="left">
	<table border="0" width="144" cellspacing="4" cellpadding="0" id="table3">
		<tr>
			<td width="49" align="center" valign="top">
					<font face="Arial" style="font-size: 9pt" color="#000000">
					<a href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_103" style="text-decoration: none">
					<font color="#000000">
					<a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_115">
					<font color="#000000">XS</font></a></font></a></font><a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_115"><font color="#000000"></a></font></a></td>
			<td width="23" align="center" valign="top">
					 </td>
			<td width="57" align="center" valign="top">
					<a href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_100" style="text-decoration: none">
					<font face="Arial" style="font-size: 9pt" color="#000000">
					<a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_123">
					<font color="#000000">UK 
					12</font></a></font></a></td>
		</tr>
		<tr>
			<td width="49" align="center" valign="top">
					<font face="Arial" style="font-size: 9pt" color="#000000">
					<a href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_104" style="text-decoration: none">
					<font color="#000000">
					<a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_116">
					<font color="#000000">SML</font></a></font></a></font><a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_116"><font color="#000000"></a></font></a></td>
			<td width="23" align="center" valign="top">
					 </td>
			<td width="57" align="center" valign="top">
					<font face="Arial" style="font-size: 9pt" color="#000000">
					<a href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_101" style="text-decoration: none">
					<font color="#000000">
					<a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_124">
					<font color="#000000">UK 14</font></a></font></a></font><a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_124"><font color="#000000"></a></font></a></td>
		</tr>
		<tr>
			<td width="49" align="center" valign="top">
					<font face="Arial" style="font-size: 9pt" color="#000000">
					<a href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_105" style="text-decoration: none">
					<font color="#000000">
					<a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_117">
					<font color="#000000">MED</font></a></font></a></font><a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_117"><font color="#000000"></a></font></a></td>
			<td width="23" align="center" valign="top">
					 </td>
			<td width="57" align="center" valign="top">
					<font face="Arial" style="font-size: 9pt" color="#000000">
					<a href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_102" style="text-decoration: none">
					<font color="#000000">
					<a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_125">
					<font color="#000000">UK 16</font></a></font></a></font><a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_125"><font color="#000000"></a></font></a></td>
		</tr>
		<tr>
			<td width="49" align="center" valign="top">
					<font face="Arial" style="font-size: 9pt" color="#000000">
					<a href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_106" style="text-decoration: none">
					<font color="#000000">
					<a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_118">
					<font color="#000000">LRG</font></a></font></a></font><a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_118"><font color="#000000"></a></font></a></td>
			<td width="23" align="center" valign="top">
					 </td>
			<td width="57" align="center" valign="top">
					<font face="Arial" style="font-size: 9pt">
					<a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_126">
					<font color="#000000">UK 18</font></a></font></td>
		</tr>
		<tr>
			<td width="49" align="center" valign="top">
					<font face="Arial" style="font-size: 9pt" color="#000000">
					<a href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_107" style="text-decoration: none">
					<font color="#000000">
					<a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_119">
					<font color="#000000">XLG</font></a></font></a></font><a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_119"><font color="#000000"></a></font></a></td>
			<td width="23" align="center" valign="top">
					 </td>
			<td width="57" align="center" valign="top">
					<font face="Arial" style="font-size: 9pt">
					<a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_127">
					<font color="#000000">UK 20</font></a></font></td>
		</tr>
		<tr>
			<td width="49" align="center" valign="top">
					<font face="Arial" style="font-size: 9pt">
					<a href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_97" style="text-decoration: none">
					<font color="#000000">
					<a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_120">
					<font color="#000000">UK 6</font></a></font></a></font></td>
			<td width="23" align="center" valign="top">
					 </td>
			<td width="57" align="center" valign="top">
					<font face="Arial" style="font-size: 9pt">
					<a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_128">
					<font color="#000000">UK 22</font></a></font></td>
		</tr>
		<tr>
			<td width="49" align="center" valign="top">
					<font face="Arial" style="font-size: 9pt">
					<a href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_98" style="text-decoration: none">
					<font color="#000000">
					<a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_121">
					<font color="#000000">UK 8</font></a></font></a></font></td>
			<td width="23" align="center" valign="top">
					 </td>
			<td width="57" align="center" valign="top">
					<font face="Arial" style="font-size: 9pt">
					<a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_129">
					<font color="#000000">UK 24</font></a></font></td>
		</tr>
		<tr>
			<td width="49" align="center" valign="top">
					<font face="Arial" style="font-size: 9pt" color="#000000">
					<a href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_99" style="text-decoration: none">
					<font color="#000000">
					<a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_122">
					<font color="#000000">UK 10</font></a></font></a></font><a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_122"><font color="#000000"></a></font></a></td>
			<td width="23" align="center" valign="top">
					 </td>
			<td width="57" align="center" valign="top">
					<font face="Arial" style="font-size: 9pt">
					<a style="text-decoration: none" href="http://www.limelites.co.uk/index.php?main_page=index&cPath=1_130">
					<font color="#000000">UK 26</font></a></font></td>
		</tr>
		</table>
</div>');

?>
5 Apr 2009, 10:54 AM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Adding a URL to Custom Sidebox Headings

I noticed that your example in post 1 doesn't close the <a>, which would tend to explain why the following content is also clickable:php define('BOX_HEADING_TROUSERS_SIZES_SIDEBOX', '<a href="/index.php?main_page=index&cPath=1_5"> Trousers'); should be```php
define('BOX_HEADING_TROUSERS_SIZES_SIDEBOX', '<a href="/index.php?main_page=index&cPath=1_5"> Trousers</a>');

5 Apr 2009, 11:58 AM
#6
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Adding a URL to Custom Sidebox Headings

Hi Glen,

Thank you for that.... I knew I was doing something simply dumb :-) Thanks for pointing out the missing </a> as this has sorted the problem ......