Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

horizontal navigation bar


gshutzy

Recommended Posts

i have been trying this for months, on and off. i am now trying to get the superfish into my site. im running v2.3.1. and i am having some difficulty with the file modifications. i have read in other posts that others have had the same problems but there questions seemed to me to go unanswered. there were many replies but not many solutions. was i missing something?

 

i am having trouble with this

 

STEP 2: Reference the installed files

If you are using the OSC to CSS contribution (tableless OSCommerce)

open includes/application_top.php

change:

$stylesheet='<link rel="stylesheet" type="text/css" href="stylesheet.css"/>

';

to:

$stylesheet='<link rel="stylesheet" type="text/css" href="stylesheet.css"/>

<script type="text/javascript" src="javascript/superfish.js"></script>

<link rel="stylesheet" type="text/css" media="screen" href="css/superfish.css" />

';

If you are using the Standard OSCommerce place the following references in each catalog page between the <head> and </head> tags:

<link rel="stylesheet" href="css/superfish.css" />

<script type="text/javascript" src="javascript/superfish.js"></script>

 

i have read that on v2.3.1 that this code does not exist in the application_top.php file and that in v2.3.1. i will have to modify the template_top.php file instead but the does not seem to be any instruction as to what code do i alter and what to alter/replace it with.

 

thanks for any help given

Link to comment
Share on other sites

@@gshutzy

http://addons.oscommerce.com/info/8165

You can find superfish menu building application in it for v2.3.1.

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

Try looking in includes/template_top. That is where most css and javascript are called from.

 

<link rel="stylesheet" type="text/css" href="stylesheet.css" />

 

is in this folder.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

In OSC to CSS you place the stylesheet reference in the includes/application_top.php. Look near the bottom for something like this:

 

$stylesheet='
<link rel="stylesheet" type="text/css" media="all" href="css/style.css" />
<script type="text/javascript" src=" '.(isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://') . 'ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src=" '.(isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://') . 'ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/jquery.json-pretty.js"></script>
<script type="text/javascript" src="js/loginbox.js"></script>
';

 

This defines the variable $stylesheet. Just add another line to the above to add any javascript or css reference (taking note of proper php syntax). Since in OCS to CSS the variable $stylesheet has been added to every catalog page header, this single change in application_top.php will add your reference to the header in all catalog pages.

 

You could do this in 2.3. Just add the above code near the bottom of application_top.php in and then go through each catalog page and add this to every header:

 

<php echo $stylesheet; ?>

You only have to do it once, and from then on out it will be a breeze to change stylesheet and javascript references.

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

Hi,

Done it on this site wanted to upload as add on but moving house hassle etc.. http://www.demo1.osc-design.com/ so have not found the time yet. I used the original super fish files (jJSS) as I found easier to custimise take a look at the page source and maybe the webdeveloper tools and you will see what I did added a jquery noconflict to the end because of the theme switcher installed on front page you probably would not need.

John

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

  • 4 weeks later...

@@gshutzy

http://addons.oscommerce.com/info/8165

You can find superfish menu building application in it for v2.3.1.

 

Hi Gergely

 

I installed this addon and i think i must have missed something as this here is what i see on my website : crazycarz.pt

 

As you can see there is only one block stating Manufacturers but i can´t get anything else to show up , what did i do wrong here?

 

Thanks in advance,

 

 

Rob

Link to comment
Share on other sites

Ah , i found one thing , in the install guide i have it says add include(DIR_WS_BOXES . 'extends.php'); and this should be include(DIR_WS_BOXES . 'box_extends.php');

 

Winmerge is so handy sometimes ;-)

 

So that is one thing solved.

Link to comment
Share on other sites

Hi Rob,

 

Not sure how Gergely's addon works but might you have forgot to add the code below to the header php???

 

<!--Superfish Horizontal Navigation bar-->

<div class="cat_navbar">

<?php

if ( file_exists(DIR_WS_MODULES.'cat_navbar.php') ) {

require(DIR_WS_MODULES.'cat_navbar.php');

}

?>

</div>

<div class="clear"></div>

<!--end Superfish--></div>

 

 

 

and uploaded includes/modules/cat_navbar.php

 

John

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

Hi Rob, Not sure how Gergely's addon works but might you have forgot to add the code below to the header php???

 

and uploaded includes/modules/cat_navbar.php John

 

Hi John

 

Thanks for your respons.

I think this menu is adapted to work with the Header Footer Content addon from Gergely.

It works now , just some minor little bugs to catch and it should do the trick.

 

Thanks again.

 

Gr,

 

Rob

Link to comment
Share on other sites

  • 2 months later...

Hello,

 

I was looking for a topic about horizontal navigation, using superfish.

My problem is that cat_navbar.php doesn't generate a valid css horizontal menu, when you have level 0 and level 1 sub menu. The result is like that:

<ul class="sf-menu">
  <li class="current_0"><a ...>...</a></li>
  <li class="current_0"><a ...>...</a></li>
  <li class="current_0"><a ...>...</a>
  <ul>
	 <li class="current_1"><a ...>...</a></li>
  </ul>
</ul>

There's a closed </li> which is not générated.

 

Does anybody can help me, please ?

 

Many thanks

Link to comment
Share on other sites

Ok, even if i've not time enough to test with more sub-level, i've patched the problem with sub-level 1 only.

You need to add this in cat_navbar.php:

function tep_make_catsf_ullist($rootcatid = 0, $maxlevel = 0){
.....
$output .= tep_make_catsf_ulbranch($rootcatid, $table, 0, $maxlevel);
// Close off nested lists

/*----ADD THIS----*/
if($GLOBALS['this_level'] > 0)
{
   for ($nest = 0; $nest < $GLOBALS['this_level']; $nest++)
   {
        $output .= '</ul></li>';
   }
}
/*---END---*/

for ($nest = 0; $nest < $GLOBALS['this_level']; $nest++) {
 $output .= '</ul>';
}
return $output;
}

 

Now, that's valid css

 

xpatval

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...