Latest News: (loading..)

Archived

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

nitromethan

Link of some Subcategories must be linking to another Site

2 posts in this topic

Hello,

 

I have a osCommerce V2.2 RC2 with some Categories and Subcategories. By some Subcategories I want to link to another Page. For the survey at the middlecontainer I did this on this way in the index.php:

 

<tr><td class="name name4_padd">'; if($categories['categories_name'] == "Subcategory1") { echo '<a href="myownPage.php">Subcategory1</a>'; }  else if($categories['categories_name'] == "Subcategory2") { echo '<a href="myownPage1.php">Subcategory2</a>'; } else { echo  $p_name_sub; } echo '</td></tr>';

 

It works well! But how I can do this for the Navigation ? I mean:

 

Category1

Subcategory1 ---> must be linking to myownPage.php

Subcategory2 ---> must be linking to myownPage1.php

Subcategory3 ---> linking normal

Subcategory4 ---> linking normal

Category2

 

Subcategory1 ---> linking normal

Subcategory2 ---> linking normal

 

I hope you know what i mean....

 

Thanks a lot!

 

 

best regards

Share this post


Link to post
Share on other sites

Are you talking about the Categories menu?

 

Probably easier to just do by cPath.

 

In boxes/categories.php you could try modifying the categories string where it builds the url. This is untested, also from a 2.3, but probably the same.

$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';

 

To...

 

$cPathVar = $tree[$counter]['path'];  
switch ($cPathVar) {
case '2_19': // Your Custom Page cPath
  $categories_string .= tep_href_link('your_custom_page.php').'">';
 break;
case '2_18': // Your Custom Page cPath
  $categories_string .= tep_href_link('your_custom_page.php').'">';
 break;
default:
  $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';  
 break;
}

 

You could also use if else if thats eaiser.

 

This is untested and not from a MS2.2, so backup!

Share this post


Link to post
Share on other sites