Zima Posted January 25, 2004 Share Posted January 25, 2004 Hello, I have manually created links to my categories and subcategories for my category box. My question is what is the smart way to link so the user doesn't get logged out and is Bot friendly. Example: Right now it is <a href="/index.php/cPath/21"> The full url i.e. <a href="http://www.domain.com/index.php/cPath/21"> logs the user out as it is missing the ID. Any suggestions? I am totally new at PHP. How to link to a category within the store? Thanks! Link to comment Share on other sites More sharing options...
Guest Posted January 25, 2004 Share Posted January 25, 2004 Dunno about "bot friendly", but, eg. <?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=21') . '">' . YOUR_LINK_DEFINE . '</a>'; ?> You will need to know the cPath to where you wish to travel :P Matti Link to comment Share on other sites More sharing options...
241 Posted January 25, 2004 Share Posted January 25, 2004 Matti Is there a method to pull a specific category say as in above cPath=21 and display the contents of that category in a page No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes. Link to comment Share on other sites More sharing options...
Guest Posted January 25, 2004 Share Posted January 25, 2004 Not sure what you mean - the above will display that category. Matti Link to comment Share on other sites More sharing options...
Guest Posted January 25, 2004 Share Posted January 25, 2004 BTW - I just edited the above code - there was a space between cPath and = which would give an invalid link Link to comment Share on other sites More sharing options...
Guest Posted January 25, 2004 Share Posted January 25, 2004 Perhaps you mean something like this? <?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=1_4') . '">' . YOUR_LINK_DEFINE . '</a>'; ?> Matti Link to comment Share on other sites More sharing options...
241 Posted January 25, 2004 Share Posted January 25, 2004 Matti The idea is to have a link in the top nav bar that opens the category in a new page showing all the products within that category. Will the above code produce this result. No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes. Link to comment Share on other sites More sharing options...
Guest Posted January 25, 2004 Share Posted January 25, 2004 You can do that like this: <?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=1_4') . '" target="_blank">' . YOUR_LINK_DEFINE . '</a>'; ?> Matti Link to comment Share on other sites More sharing options...
241 Posted January 25, 2004 Share Posted January 25, 2004 Thanks Matti No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes. Link to comment Share on other sites More sharing options...
Zima Posted January 26, 2004 Author Share Posted January 26, 2004 Much Appreciated Matti! PS. If the link name is more than one word i.e. "Hot Items" , I get a parse error. I replaced YOUR_LINK_DEFINE with the word "Hot Items". I guess it's a formatting error.. One word links work perfectly Link to comment Share on other sites More sharing options...
Zima Posted January 26, 2004 Author Share Posted January 26, 2004 I figured it out.. I forgot to remove the quotes and the period : ' . Hot Items . ' Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.