sambo25 Posted August 23, 2010 Posted August 23, 2010 Hi guys, I am wanting to customize the category links on the left-hand side of the page to link to internal (about.php etc.) and external (an external blog site) links. I realize that they now only link to product categories, but is there a way around this? I have read a support forum on this matter: http://www.oscommerce.com/forums/topic/296984-customize-category-links/ However I am using a Template Monster template, and I believe that the code in this differs from a usual oscommerce template. I understand the remedy probably lies in includes/boxes/categories however do not know where. Here is my code: $categories_string .= '<a href="'; if ($tree[$counter]['parent'] == 0) { $cPath_new = 'cPath=' . $counter; } else { $cPath_new = 'cPath=' . $tree[$counter]['path']; } $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">'; if (isset($cPath_array) && in_array($counter, $cPath_array)) { $categories_string .= '<b>'; } If anyone could help, it would be really appreciated! Thanks so much, Sam
germ Posted August 24, 2010 Posted August 24, 2010 Some code here That shows how to insert a link to a page OUTSIDE ths shop. You'd want to use the tep_href_link() function to code links to other pages WITHIN the shop. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
sambo25 Posted August 24, 2010 Author Posted August 24, 2010 Some code here That shows how to insert a link to a page OUTSIDE ths shop. You'd want to use the tep_href_link() function to code links to other pages WITHIN the shop. Thanks very much for your help germ, will look into it. Regards, Sam
sambo25 Posted August 24, 2010 Author Posted August 24, 2010 Thanks very much for your help germ, will look into it. Regards, Sam Hi germ, This does work, however the new link is not in keeping with the theme. Is there any way to ensure the new link has the same box as all the other category links? This is the code I have when I have implemented your solution (have just made google as the example link for this but have tried an internal link to no avail): tep_show_category($first_element, $count); $categories_string .= '<a target="_blank" href="http://www.google.com">Google</a>'; $info_box_contents = array(); $info_box_contents[] = array('text' => '<ul class="categories">' . $categories_string . '</ul>'); I notice this code is a little different to the code you provided. Could this be why it does not stay in keeping with my theme? Again, I am using a template monster theme. (http://www.templatemonster.com/oscommerce-templates/28406.html) Again, thank you so much for your help germ - I'd be clueless without people like you helping! Sam
germ Posted August 24, 2010 Posted August 24, 2010 If your links are using a class or other HTML you'd have to include in the code that to make them look like the rest of the links. Without seeing your site I couldn't say what code is required. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
sambo25 Posted August 25, 2010 Author Posted August 25, 2010 If your links are using a class or other HTML you'd have to include in the code that to make them look like the rest of the links. Without seeing your site I couldn't say what code is required. Is there not just a way to make all the links categories (eg. make "About Us" a product category), and merely alter the link eg. index.php?cPath=9 to about.php ? Regards, Sam Henderson
germ Posted August 25, 2010 Posted August 25, 2010 If you PM me the URL to your site I'll help with the code. That's much simpler. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
Recommended Posts
Archived
This topic is now archived and is closed to further replies.