Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / new sidebox created. how to add links??

new sidebox created. how to add links??

Views: 1,506

Results 1 to 16 of 16
17 Jan 2011, 10:23 AM
#1
maxy007 avatar

maxy007

Zen Follower

Join Date:
Dec 2010
Posts:
248
Plugin Contributions:
0

new sidebox created. how to add links??

Hi there,
I've created a new sidebox called Tips and tricks. How do i add page links to it??
I want to add a link to the following 2 pages:
E-Juice
eGo maintenance
I haven't created the pages yet.

Website is https://www.lovetovape.com.au

Thanks for reading!! :smartalec:

17 Jan 2011, 1:58 PM
#2
stevesh avatar

stevesh

Black Belt

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

Re: new sidebox created. how to add links??

I assume the pages will be EZ pages. Just create HTML links to the pages in question in the blank_sidebox_defines.php file where it says 'Replace this text ...'.

EZ page links look like this: http: //www.yoursite/index.php?main_page=page&id=5 where 5 is the EZ page id.

17 Jan 2011, 6:57 PM
#3
maxy007 avatar

maxy007

Zen Follower

Join Date:
Dec 2010
Posts:
248
Plugin Contributions:
0

Re: new sidebox created. how to add links??

Hi Stevesh,
I've created one page called E-Juice using EZ-pages. The page ID is 5.
While this page now shows up under the heading "important links" (I don't want it there). I want it under the heading Tips and Tricks.

I can't get it to show up under my Tips and Tricks heading???

In my includes/languages/English/extra_definitions/blank_sidebox_defines.php. I have the following:

<?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', 'Tips_and_Tricks'); define('TEXT_Tips and Tricks_SIDEBOX', '<a href="http://www.lovetovape.com.au/index.php?main_page=page&id=5">E-Juice</a>'); ?>

In my includes/templates/template_default/sideboxes/tpl_blank_sidebox.php ** I have the following:
<?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>' .Tips_and_Tricks . '</p>';
$content .= '<p>www.lovetovape.com.au/index.php?main_page=page&id=5</p>';

$content .= '</div>';
?>
What do I need to change to get E-Juice as a link under my Tips and Tricks heading.

Thanks,

Maxy

17 Jan 2011, 7:14 PM
#4
stevesh avatar

stevesh

Black Belt

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

Re: new sidebox created. how to add links??

You don't need to place the HTML in both files - either will do. I usually use the blank_sidebox_defines.php file, but I can't tell you why.

Since you have the EZ page enabled now in the Important Links sidebox, click on it and just copy the URL from the address bar and paste it in the blank sidebox link - it looks like you have some extra characters in there now.

If you don't want that page in the Important Links sidebox, click 'No' under 'Header' on the EZ page setup.

17 Jan 2011, 7:23 PM
#5
maxy007 avatar

maxy007

Zen Follower

Join Date:
Dec 2010
Posts:
248
Plugin Contributions:
0

Re: new sidebox created. how to add links??

Thanks Stevesh,
So do I put the address from my new page into the part that's red below??

<?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](http://www.zen-cart.com/forum/../license/2_0.txt) GNU Public License V2.0 * @version $Id: blank_sidebox.php 2007-05-26 kuroi $ */ define('BOX_HEADING_BLANK_SIDEBOX', 'Tips_and_Tricks'); define('TEXT_Tips and Tricks_SIDEBOX', '<a href="http://www.lovetovape.com.au/index.php?main_page=page&id=5"</a>'); ?>

Does anything need cleaning up?

17 Jan 2011, 7:25 PM
#6
stevesh avatar

stevesh

Black Belt

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

Re: new sidebox created. how to add links??

That should work.

17 Jan 2011, 7:31 PM
#7
maxy007 avatar

maxy007

Zen Follower

Join Date:
Dec 2010
Posts:
248
Plugin Contributions:
0

Re: new sidebox created. how to add links??

I've added that to

what part do i need to change of the file below to get it back to normal? if I remove the part in red, the tips and tricks heading doesn't show up in the sidebox.

In my includes/templates/template_default/sideboxes/tpl_blank_sidebox.php ** I have the following:
<?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>' .Tips_and_Tricks . '</p>';
$content .= '<p>www.lovetovape.com.au/index.php?main_page=page&id=5</p>';

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

17 Jan 2011, 7:43 PM
#8
stevesh avatar

stevesh

Black Belt

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

Re: new sidebox created. how to add links??

The box heading is defined in blank_sidebox_defines.php, not in the template file. That, come to think of it, is why I use that file for the HTML, too.

I would replace the template file (tpl_blank_sidebox.php) with the original file and edit blank_sidebox_defines.php like this:

<?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', 'Tips and Tricks'); define('TEXT_BLANK_SIDEBOX', '<a href="http://www.lovetovape.com.au/index.php?main_page=page&id=5">E-Juice</a>'); ?>
17 Jan 2011, 8:05 PM
#9
maxy007 avatar

maxy007

Zen Follower

Join Date:
Dec 2010
Posts:
248
Plugin Contributions:
0

Re: new sidebox created. how to add links??

Awesome!!!
Thanks Stevesh. That worked.

If I wanted to add other pages under that heading would I just add a URL like it is below on new lines?

define('BOX_HEADING_BLANK_SIDEBOX', 'Tips and Tricks');
define('TEXT_BLANK_SIDEBOX', '<a href="http://www.lovetovape.com.au/index.php?main_page=page&id=5">E-Juice</a>');

Cheers,

Maxy

17 Jan 2011, 8:10 PM
#10
stevesh avatar

stevesh

Black Belt

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

Re: new sidebox created. how to add links??

Yes, you would just add another <a href ...>, maybe after a <br/> or two. You can style everything in the stylesheet.

20 Jan 2011, 12:41 AM
#11
maxy007 avatar

maxy007

Zen Follower

Join Date:
Dec 2010
Posts:
248
Plugin Contributions:
0

Re: new sidebox created. how to add links??

Hi Stevesh,
I now have another problem.
I have an image as a sidebox but it's not usinfg a mod. I think this was sort of created by the template. Anyway somehow the text Tips_and_Tricks is underneith the hsidebox image. Even though it's not visable it's there and it's making the page E-Juice be out of alignment.

Do you or anyone else know how I can get rid of the text?
I was given instructions for a similar issue in another thread but this is realy doing my head in. I just can't work it out.

please help!!

Maxy

20 Jan 2011, 11:38 AM
#12
stevesh avatar

stevesh

Black Belt

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

Re: new sidebox created. how to add links??

Sorry, I don't see what you mean.

21 Jan 2011, 3:10 AM
#13
maxy007 avatar

maxy007

Zen Follower

Join Date:
Dec 2010
Posts:
248
Plugin Contributions:
0

Re: new sidebox created. how to add links??

In the image I've highlighted the text that shouldn't be there.
This is the text I want to remove

15 Jul 2011, 9:36 AM
#14
triple_moon_ranch avatar

triple_moon_ranch

New Zenner

Join Date:
Feb 2008
Posts:
15
Plugin Contributions:
0

Re: new sidebox created. how to add links??

This sidebox works great! The only thing I can't figure out is,
There is sort of a double space between the heading and the first link. (much more than the pre loaded sideboxes. I would like to have about the same amount of space as the pre-loaded boxes have. How woudl I go about making this space smaller?

Thanks in advance for any assistance.

15 Jul 2011, 10:10 AM
#15
stevesh avatar

stevesh

Black Belt

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

Re: new sidebox created. how to add links??

Remove the <p> tags that bracket the content you've added in tpl_blank_sidebox.php. Leave the single quotes, though.

15 Jul 2011, 11:00 AM
#16
triple_moon_ranch avatar

triple_moon_ranch

New Zenner

Join Date:
Feb 2008
Posts:
15
Plugin Contributions:
0

Re: new sidebox created. how to add links??

Thanks so much for the fast answer! I kind of thought they were the problem but was afraid if I took them out I would mess it up.

I took them out and it's the same as the other boxes now.

Thanks again, you really helped me out!