Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Navigation bar type thing


Guest

Recommended Posts

I want to create a navigation bar along the top of my site directly under the logo. I have made my four little buttons, let call them one.gif, two.gif, three.gif and four.gif

 

They are going to link to

/store/default.php/cPath/56

/store/default.php/cPath/21

/store/default.php/cPath/22

/store/default.php/cPath/24

 

this is my store

 

www.cheapsheetmusic.co.uk/store

 

Any thoughts? Is this easy or difficult? I could put them into the text easily enough but I want them along the top.

Link to comment
Share on other sites

Look in contributions for the tabs module - it auto creates tabs for your categories. Set the tabs to look like the buttons and Voila

Link to comment
Share on other sites

My friend, who's conveniently a programmer, has written some code for me and inserted it into default.php which gives me some neat little buttons, which is exactly what I wanted.

 

Have a look and see if it's the kind of thing you were after.

 

www.cheapsheetmusic.co.uk/store

 

It needs cutting and pasting into ALL php pages in order to show on all of them but if you like it, when she tells me what she has done, I will put the code here for you. You will need to replace the images with your own obviously and change the links to your own paths, but that is not hard.

 

If you wanted it to go directly below the logo and above the narrow maroon bar that is already there (maroon on mine anyway) then it is a lot easier, you just put it in header.php under the logo code and it will be on all pages automatically. But I wanted mine where it is.

 

When I've got it I will post it here.

Link to comment
Share on other sites

i like what you have done.... but there has to be an easier way.

 

touching all of the pages is scary.

 

i am better at concept than actual code, but why not use the category image that the software already has an input for? then for each one, pop the photo and link somewhere on the top of the site.

 

any takers?

Link to comment
Share on other sites

I think the only way to do it without going into all of the pages is to input the code directly into header.php then it would appear immediately below the logo. You could put some free space in there if you like between the logo and the buttons.

 

My friend created a separate includes file and then simply put about 3 lines of code into default.php telling it to put the contents of that file there. All I have to do is copy that bit of code to the right place in each php files - a bit of a fag doing it in every page but not difficult. Then if I want to change the nav bar, I just go to the new file that she made and change it there and it will change it globally.

 

There's no reason why you couldn't use the same images as your category ones if you like - I wanted all mine to match.

 

If you want the code I will let you have it anyway. I am sure she wouldn't mind.

Link to comment
Share on other sites

OK, first create a file in catalog/includes called additionaltopmenubar.php. This is best done by copying and renaming another php file and then totally replacing its contents with

 

<table align="center" border="0" width="100%" cellspacing="0" cellpadding="0"> 

 <tr>

   <td valign="middle" align="center"><a href="http://mydomain.com/catalog/default.php/cPath/1"><img src="images/imageone.gif " border="0"></a></td>

   <td valign="middle" align="center" width="10"> </td>

   <td valign="middle" align="center"><a href="http://mydomain.com/catalog/default.php/cPath/2"><img src="images/imagetwo.gif  " border="0"></a></td>

   <td valign="middle" align="center" width="10"> </td>

   <td valign="middle" align="center"><a href="http://mydomain.com/catalog/default.php/cPath/3"><img src="images/imagethree.gif " border="0"></a></td>

   <td valign="middle" align="center" width="10"> </td>

   <td valign="middle" align="center"><a href="http://mydomain.com/catalog/default.php/cPath/4"><img src="images/imagefour.gif  " border="0"></a></td>

<td valign="middle" align="center" width="10"> </td>

   <td valign="middle" align="center"><a href="http://mydomain.com/catalog/default.php/cPath/5"><img src="images/imagefive.gif" border="0"></a></td>

 </tr>

 <tr>

   <td colspan="7" height="15"></td>

 </tr>

</table>

 

You will obviously need to replace

 

http://mydomain.com/catalog/default.php/cPath/1

http://mydomain.com/catalog/default.php/cPath/2

http://mydomain.com/catalog/default.php/cPath/3

http://mydomain.com/catalog/default.php/cPath/4

http://mydomain.com/catalog/default.php/cPath/5

 

and

 

imageone.gif

imagetwo.gif

imagethree.gif

imagefour.gif

imagefive.gif

 

with your own links and images.

 

Create the images and upload them to catalog/images

 

Then in every php page you want the buttons to appear in, find:

 

<td width="100%" valign="top">

<table border="0" width="100%" cellspacing="0" cellpadding="0">

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

         <tr>

           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

         </tr>

       </table></td>

 

and replace with

 

<td width="100%" valign="top">

<!-- additional top menu bar //-->

<?php require(DIR_WS_INCLUDES . 'additionaltopmenubar.php'); ?>

<!-- additional top menu bar_eof //-->

<table border="0" width="100%" cellspacing="0" cellpadding="0">

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

         <tr>

           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

         </tr>

       </table></td>

 

and voila - nav buttons.

 

Have fun

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...