Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default 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.

    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:

    PHP Code:
    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

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

  2. #2
    Join Date
    Aug 2006
    Location
    UK
    Posts
    449
    Plugin Contributions
    0

    Default 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;

    HTML Code:
    <!--// 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?verbos...ndex&cPath=1_5
    ~Steve~

  3. #3
    Join Date
    Aug 2006
    Location
    UK
    Posts
    449
    Plugin Contributions
    0

    Default Re: Adding a URL to Custom Sidebox Headings

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

  4. #4
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default 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 Code:
    <?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">
                        &nbsp;</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">
                        &nbsp;</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">
                        &nbsp;</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">
                        &nbsp;</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">
                        &nbsp;</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">
                        &nbsp;</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">
                        &nbsp;</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">
                        &nbsp;</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. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default 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 Code:
    define('BOX_HEADING_TROUSERS_SIZES_SIDEBOX''<a href="/index.php?main_page=index&cPath=1_5"> Trousers'); 
    should be
    PHP Code:
    define('BOX_HEADING_TROUSERS_SIZES_SIDEBOX''<a href="/index.php?main_page=index&cPath=1_5"> Trousers</a>'); 

  6. #6
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default 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 ......

 

 

Similar Threads

  1. url page headings
    By artifaxworthing in forum General Questions
    Replies: 1
    Last Post: 29 Sep 2010, 07:04 PM
  2. Adding Custom Pages in Information Sidebox
    By warsaw in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 24 Sep 2010, 05:56 PM
  3. Sidebox headings
    By DanAllkins in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 20 Oct 2006, 05:40 PM
  4. Problem adding javascript to custom sidebox
    By etrader in forum Basic Configuration
    Replies: 2
    Last Post: 28 Aug 2006, 04:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg