Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Adding image link to index page only

Adding image link to index page only

Locked

Views: 1,483

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
11 Nov 2010, 11:08 PM
#1
tor86 avatar

tor86

New Zenner

Join Date:
Sep 2010
Location:
Leamington Spa, UK
Posts:
31
Plugin Contributions:
0

Adding image link to index page only

Hi everyone,

I'm having trouble adding a single image link to my index page. I used this code in my "tpl_index_categories.php" file -

<div id="tuitionbutton"><a href="<?php echo zen_href_link("page&id=2", '', 'NONSSL'); ?>"> <img height="147" width="316" title="Tuition" alt="Tuition" src="../images/tuitionbutton.jpg"></a></div>

but this repeats the image on every product page. The image I'm trying to display is the "Tuition" button in the category block.

notoriousdesign.co.uk/dr.um

Thanks in advance for your help! :D

12 Nov 2010, 12:57 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Adding image link to index page only

I'm having trouble adding a single image link to my index page
Why did you select tpl_index_categories.php for this??

I can't see where you want this displayed so can not recommend a better place at the moment

12 Nov 2010, 10:29 PM
#3
tor86 avatar

tor86

New Zenner

Join Date:
Sep 2010
Location:
Leamington Spa, UK
Posts:
31
Plugin Contributions:
0

Re: Adding image link to index page only

kobra:

Why did you select tpl_index_categories.php for this??

I can't see where you want this displayed so can not recommend a better place at the moment

As that's where I found the code for the top level categories.. I'm guessing that's the wrong place then! haha.

I just want this image link to appear on the home page content area, as I basically want a group of 6 image links, with 5 of them being the existing categories (drums, cymbals etc), and the other image linking to an EZpage (Tuition)

12 Nov 2010, 10:35 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Adding image link to index page only

I just want this image link to appear on the home page content area, as I basically want a group of 6 image links, with 5 of them being the existing categories (drums, cymbals etc), and the other image linking to an EZpage (Tuition)
If only for the home page try editing from the admin > tools > define page editor >main_page.php

Add your 6 image links & any text using standard html coding

12 Nov 2010, 10:49 PM
#5
tor86 avatar

tor86

New Zenner

Join Date:
Sep 2010
Location:
Leamington Spa, UK
Posts:
31
Plugin Contributions:
0

Re: Adding image link to index page only

ahhh of course!! Thanks very much!

Is it best to add the category links like that or via the catalog menu, as at the moment that image link has shunted everything down.

This is my CSS for it..

#tuitionbutton {
position:relative;
top:454px;
width:316px;
left:319px;
height:147px;
}

I tried floating it too but that messed everything up completely.

cheers for the help :smile:

12 Nov 2010, 11:02 PM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Adding image link to index page only

Is it best to add the category links like that or via the catalog menu, as at the moment that image link has shunted everything down.
Can't see your site???

But you probably need to alter your href links to be more like

<div id="tuitionbutton"><a href="/index.php?main_page=page_2"><img height="147" width="316" title="Tuition" alt="Tuition" src="../images/tuitionbutton.jpg"></a></div>
12 Nov 2010, 11:43 PM
#7
tor86 avatar

tor86

New Zenner

Join Date:
Sep 2010
Location:
Leamington Spa, UK
Posts:
31
Plugin Contributions:
0

Re: Adding image link to index page only

ah ok thanks.

Here's the link - notoriousdesign.co.uk/dr.um

13 Nov 2010, 12:24 AM
#8
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Adding image link to index page only

Yeah I would do this in you main_page.php file and see how it looks...
You might need to resize the images to fit in the space you have

13 Nov 2010, 2:09 PM
#9
tor86 avatar

tor86

New Zenner

Join Date:
Sep 2010
Location:
Leamington Spa, UK
Posts:
31
Plugin Contributions:
0

Re: Adding image link to index page only

Yay thanks so much, that worked like a charm! :D

13 Nov 2010, 2:15 PM
#10
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Adding image link to index page only

Is this your site or are you a designer?

13 Nov 2010, 2:19 PM
#11
tor86 avatar

tor86

New Zenner

Join Date:
Sep 2010
Location:
Leamington Spa, UK
Posts:
31
Plugin Contributions:
0

Re: Adding image link to index page only

kobra:

Is this your site or are you a designer?

I'm the designer, wish I had more knowledge of PHP though. This is the first time I've used Zencart.

13 Nov 2010, 2:26 PM
#12
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Adding image link to index page only

Being older, and having learned several structured code languages, I do not or am not proficient in php as I refused to learn another and especially an interrupted language
This is not a requirement to design, as long as you can decipher code in general

If you use Fire Fox get the aardvark plugin
If you don't get it and the web tools plugin and the above

There are issues with the div locations(physical) and what should be inside of them

This might cause issues in others browsers

A good tool to see browser rendering is
http://browsershots.org/

13 Nov 2010, 2:38 PM
#13
tor86 avatar

tor86

New Zenner

Join Date:
Sep 2010
Location:
Leamington Spa, UK
Posts:
31
Plugin Contributions:
0

Re: Adding image link to index page only

kobra:

Being older, and having learned several structured code languages, I do not or am not proficient in php as I refused to learn another and especially an interrupted language
This is not a requirement to design, as long as you can decipher code in general

If you use Fire Fox get the aardvark plugin
If you don't get it and the web tools plugin and the above

There are issues with the div locations(physical) and what should be inside of them

This might cause issues in others browsers

A good tool to see browser rendering is
http://browsershots.org/

yeah I know what you mean, but I'm not entirely sure how to fix it. I've been customizing an existing template which has left it pretty messy. I'm never sure whether to use relative or float divs when positioning :dontgetit

13 Nov 2010, 2:46 PM
#14
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Adding image link to index page only

I've been customizing an existing template
If you intend on doing many other ZenCarts, I suggest that you invest the hours to learn to roll your own templates and stay within the default structure as much as possible
Most of this is graphics and css only