Zen Cart Logo
Forums / Addon Sideboxes / Attaching a hyperlink to an image in a Blank Sidebox Mod v2.0?

Attaching a hyperlink to an image in a Blank Sidebox Mod v2.0?

Locked

Views: 1,728

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
12 Jul 2009, 1:48 PM
#1
sandrasd avatar

sandrasd

New Zenner

Join Date:
Jun 2009
Posts:
85
Plugin Contributions:
0

Attaching a hyperlink to an image in a Blank Sidebox Mod v2.0?

Hello.

What is the proper way to attach a hyperlink to an image in a Blank Sidebox Mod v2.0?
I have problem with it...

Thanks.

12 Jul 2009, 1:52 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Attaching a hyperlink to an image in a Blank Sidebox Mod v2.0?

Should just be standard HTML. What problem are you having?

12 Jul 2009, 5:01 PM
#3
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,611
Plugin Contributions:
0

Re: Attaching a hyperlink to an image in a Blank Sidebox Mod v2.0?

The syntax is:

<a href="the URL"><img src="path_to_image/image_name.gif" /></a>

13 Jul 2009, 12:19 AM
#4
sandrasd avatar

sandrasd

New Zenner

Join Date:
Jun 2009
Posts:
85
Plugin Contributions:
0

Re: Attaching a hyperlink to an image in a Blank Sidebox Mod v2.0?

Hi.

Thanks for the quick reply.

I am new to PHP, so here is what I did, and my text link works, but the image is not linked...
I probably messed up my code somewhere. Can anyone help me with this?
Thanks.

Includes/languages/english/extra_definitions/blank_sidebox2_defines.php

<?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_BLANK_SIDEBOX', 'My Text');
define('TEXT_BLANK_SIDEBOX', '<a target="_self" href="http://www.mydomain.com/store/index.php?main_page=page&id=1"><div>
<font color="#FF0000">My Text!</font></div></a>');

?>

includes/templates/template_default/sideboxes/tpl_blank_sidebox2.php

<?php
/**

  • blank sidebox - allows a blank 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-05-26 kuroi $
    */

$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';

// Replace the text and HTML tags between the apostophes on lines 19 and 20.
// Use as many or as few lines using this model as you need for your custom content.
// If you have a multilingual site define your text in the languages/YOUR_LANGUAGE/extra_definitions/blank_sidebox_defines.php and include it as shown in line 19.
// If your site is monolingual, you can put the text right here as shown on line 20 (and nobody will know!)
$content .= '<p>' . TEXT_BLANK_SIDEBOX . '</p>';
$content .= '<div align="center" style="padding:5px;"><a target="_self" href="http://www.mydomain.com/store/index.php?main_page=page&id=1"><img src="https://www.mydomain.com/images/myimage.jpg" border="0" alt="My Image"></a></div>';

$content .= '</div>';
?>

includes/modules/sideboxes/blank_sidebox2.php

<?php
/**

  • blank sidebox - allows a blank 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-05-26 kuroi $
    */

// test if box should display
$show_blank_sidebox = true;

if ($show_blank_sidebox == true) {
require($template->get_template_dir('tpl_blank_sidebox2.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_blank_sidebox2.php');
$title = BOX_HEADING_BLANK_SIDEBOX;
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
?>

Also where do I write style for my text link? I would like it to look just like my other sidebox links in my template (with hover effect)...

Thanks again.

13 Jul 2009, 12:57 AM
#5
sandrasd avatar

sandrasd

New Zenner

Join Date:
Jun 2009
Posts:
85
Plugin Contributions:
0

Re: Attaching a hyperlink to an image in a Blank Sidebox Mod v2.0?

OK,

I made this mistake. I had an extra file

includes/templates/template_default/sideboxes/tpl_blank_sidebox.php uploaded in this directory:

includes/templates/theme209/sideboxes/tpl_blank_sidebox.php

I deleted this file and my image is now linked, still trying to figure out where to write CSS for my text link in this sidebox...
Can you help?