LeeFoster Posted March 22, 2020 Share Posted March 22, 2020 Is there any addon's or does anyone know of a way to turn a category into a link so that when the category is clicked it takes you to a different website? Link to comment Share on other sites More sharing options...
Jack_mcs Posted March 23, 2020 Share Posted March 23, 2020 @LeeFoster You will need to code that. Below are a few ways to do it that I can think of at the moment. But unless there is some reason to have the link be a category, I would just delete that category and add the link manually, which is similar to the second method below. Leaving it as a category will always be a potential problem because if you install an addon that lists or uses categories, its code may require changing. And if you forget, it could cause a problem on your site. - Edit the classes/categories_tree.php and change the code to look for that categories ID and add the url you want for it. Something like if (categories_id = 33) { url = somehwhere else; } else { original code goes here } - Edit the above file and change the database query not to include the category in the result. Then in the categories infobox, add a link after the rest of the categories for the one you want. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
LeeFoster Posted March 23, 2020 Author Share Posted March 23, 2020 17 minutes ago, Jack_mcs said: @LeeFoster You will need to code that. Below are a few ways to do it that I can think of at the moment. But unless there is some reason to have the link be a category, I would just delete that category and add the link manually, which is similar to the second method below. Leaving it as a category will always be a potential problem because if you install an addon that lists or uses categories, its code may require changing. And if you forget, it could cause a problem on your site. - Edit the classes/categories_tree.php and change the code to look for that categories ID and add the url you want for it. Something like if (categories_id = 33) { url = somehwhere else; } else { original code goes here } - Edit the above file and change the database query not to include the category in the result. Then in the categories infobox, add a link after the rest of the categories for the one you want. This is going to be for the category on the index page not the categories box, will it still work? Link to comment Share on other sites More sharing options...
burt Posted March 23, 2020 Share Posted March 23, 2020 Perform the changing of "link address" in the MODULE that outputs the display... Link to comment Share on other sites More sharing options...
LeeFoster Posted March 23, 2020 Author Share Posted March 23, 2020 4 minutes ago, burt said: Perform the changing of "link address" in the MODULE that outputs the display... Yeah I found it thanks. Link to comment Share on other sites More sharing options...
Jack_mcs Posted March 23, 2020 Share Posted March 23, 2020 33 minutes ago, LeeFoster said: This is going to be for the category on the index page not the categories box, will it still work? Making the change in the class file will affect any code in the shop that displays categories assuming the class is used to get the categories. Changing the code in the module as @burtmentioned is a better way since it won't affect core files, but it will only apply to that one module. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
LeeFoster Posted March 23, 2020 Author Share Posted March 23, 2020 Took a little trial and error to get it right but I have managed to do so, thanks. Link to comment Share on other sites More sharing options...
♥14steve14 Posted March 24, 2020 Share Posted March 24, 2020 20 hours ago, LeeFoster said: Took a little trial and error to get it right but I have managed to do so, thanks. Is it a secret or are you going to tell how you did it in case others find this thread. REMEMBER BACKUP, BACKUP AND BACKUP Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.