Forums / General Questions / linking a picture on main page to a category

linking a picture on main page to a category

Views: 626

Results 1 to 5 of 5
27 Aug 2012, 4:01 PM
#1
slavrix avatar

slavrix

New Zenner

Join Date:
Aug 2012
Posts:
10
Plugin Contributions:
0

linking a picture on main page to a category

hi, what i want to do is have 3 pictures on my main page that when you click them take you to their respective catagories.

atm i have them in the define_main_page.htm file so they load up on the main page.

what do i type for the link address or how do i do it ? ive got

<a href=""><img src="images/banner1.jpg" width="200" height="200" alt="Adults" title="Adults" /></a>
<a href=""><img src="images/banner1.jpg" width="200" height="200" alt="Kids" title="Kids" /></a>
<a href=""><img src="images/banner1.jpg" width="200" height="200" alt="Fightware" title="Fightware" 

how do i actually link them to the catagory pages though ?

i feel like im going about this the wrong way

27 Aug 2012, 4:29 PM
#2
stevesh avatar

stevesh

Black Belt

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

Re: linking a picture on main page to a category

What you have is fine, but you need to put the path to the categories inside the quotes here: <a href="">. You can navigate to the category in question and Copy the URL from the browser address bar and Paste it in the <a href="">tag. In a stock Zencart installation with sample products, the link to the Hardware category would look like this:
<a href="http://www.stevesh.org/demo/index.php?main_page=index&cPath=1">

27 Aug 2012, 4:30 PM
#3
gjh42 avatar

gjh42

Black Belt

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

Re: linking a picture on main page to a category

You have done nothing wrong; you simply need to add the URL for each category page to the href="" section. Go to the correct page, copy the URL from the address bar, and paste it into your code.

IMPORTANT: do not include any &zenid=xxxxxxx that may be shown. Also, make the URL relative instead of absolute by stripping the www.yoursite.com/ from the front, leaving only index.php?main_page=index&cPath=123 or whatever your exact path is.

27 Aug 2012, 7:37 PM
#4
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: linking a picture on main page to a category

Are Adults, Kids, and Fightware, your only categories?
If yes you could just enable the categories to alway show on mainpage, and associate the image in the category creation.

28 Aug 2012, 5:06 AM
#5
slavrix avatar

slavrix

New Zenner

Join Date:
Aug 2012
Posts:
10
Plugin Contributions:
0

Re: linking a picture on main page to a category

at the moment they are, but there may be more added later im not sure, just setting this up atm. thanks for you help guys :)