rickard_l Posted March 18, 2008 Share Posted March 18, 2008 Hi is it possible to make the links that one can create in the Category side of the site go elsewhere instead of just to that specific Category... I mean, this is what OSc creates when I made a link www.example.com/index.php?cPath=35 Instead can i make it go to... www.example.com/somepage.php ?? Link to comment Share on other sites More sharing options...
girl Posted March 21, 2008 Share Posted March 21, 2008 This is exactly the same question I have. If anyone knows some help would be super :) Link to comment Share on other sites More sharing options...
box25 Posted March 21, 2008 Share Posted March 21, 2008 This is exactly the same question I have. If anyone knows some help would be super :) Use a url rewrite rule in .htaccess file ? Link to comment Share on other sites More sharing options...
girl Posted March 21, 2008 Share Posted March 21, 2008 Use a url rewrite rule in .htaccess file ? I am thinking it might have something to do with the index.php but I don't know. I am just guessing. What is an url rewrite rule? Link to comment Share on other sites More sharing options...
Jack_mcs Posted March 21, 2008 Share Posted March 21, 2008 Yes, it is possible. One method is to edit the includes/boxes/categories.php file, trap the id for the category you want to change and use a different url for it. This works fine but if the category id's change, it will cause the code to fail unless it is changed again. The code would be something like the following, where 46 is the category id you want to link elsewhere if ($counter == '46') $categories_string .= tep_href_link(FILENAME_SOME_OTHER_PAGE) . '">'; else $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">'; Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
girl Posted March 21, 2008 Share Posted March 21, 2008 Thank you very much Jack. :) I added it around line 57, I have great categories so mine is a little modified).As I was linking externally I removed the tep_href_link and my final code look like this- if ($counter == '65') $categories_string .= ("http://www.externalsite.com/catalog") . '">'; else $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">'; /*$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new); $categories_string .= '">';*/ thanks again, I would not have gotten it without your help. Link to comment Share on other sites More sharing options...
girl Posted March 26, 2008 Share Posted March 26, 2008 Hi, using this code if ($counter == '65') $categories_string .= ("http://www.externalsite.com/catalog") . '">'; else $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">'; is it possible to added a 2nd and different external link? I have tried to repeat it but without success. Basically this is what I would like to happen counter ==65 goes to url external 1 and counter ==40 goes to url external 2 thanks for any help that can be given. Link to comment Share on other sites More sharing options...
arietis Posted March 26, 2008 Share Posted March 26, 2008 is it possible to added a 2nd and different external link? try something like f ($counter == '65') $categories_string .= ("http://www.externalsite.com/catalog") . '">'; else if ($counter == 'xx') $categories_string .= 'http:// .... ">'; else if ($counter == 'yy') $categories_stirng .= 'http:// ... ">'; else $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">'; and just repeat the 'else if' structure as often as you need. Link to comment Share on other sites More sharing options...
girl Posted March 27, 2008 Share Posted March 27, 2008 thank you that worked :) if ($counter == '65') $categories_string .= ("http://www.externalsite.com/catalog") . '">'; else if ($counter == 'xx') $categories_string .= ("http://www.externalsite2.com/catalog") . '">'; else if ($counter == 'yy') $categories_string .= ("http://www.externalsite3.com/catalog") . '">'; else $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">'; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.