amnesiak Posted March 6, 2012 Share Posted March 6, 2012 Hello, Is it possible to add a custom link to specific category in the categories block? Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted March 6, 2012 Share Posted March 6, 2012 Yes, but I wouldn't really suggest doing this. Marty Link to comment Share on other sites More sharing options...
amnesiak Posted March 7, 2012 Author Share Posted March 7, 2012 Hi Marty, Can you please tell me how can I do it and why wouldn`t you suggest it. Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted March 8, 2012 Share Posted March 8, 2012 The categories are displayed through a loop so if you hard code a link it will not be included in the loop. To add a link just open modules/blockcategories/blockcategories.tpl and add your link either immediately after the opening <ul> or immediately before the closing </ul>. You will need to add your link as a list item. <li><a href="http://www.yourlinkhere.com">Your Link Text</a></li> Remember to create a modules folder in your theme and in that folder create a folder named blockcategories. Copy the blockcategories.tpl file into this folder so your custom link will not be erased when you upgrade. Hope that helps! Marty Shue 1 Link to comment Share on other sites More sharing options...
amnesiak Posted March 10, 2012 Author Share Posted March 10, 2012 Hi Marty, I tried the code but nothing changes when I paste it. It does not show at categories block. (force compile is on) I pasted it in different places as suggested, Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted March 10, 2012 Share Posted March 10, 2012 Do you have cache set to 'no'? It worked for me. Marty Shue Link to comment Share on other sites More sharing options...
amnesiak Posted March 11, 2012 Author Share Posted March 11, 2012 Yes, it works now. Setting cache to no did the trick. Thank you. Is it also possible to add subcategories under that link? The reason I wanted to add custom link is that I want to remove those "no_image" images under subcategories and keep the ones with images to show as defined. As I could`t find the answer for that I tried this alternative. Anyway, thank you very much. EDIT: I found a way for subcategories: <li class="submenu"><a href="#">Link with drop-down</a> <ul> <li><a href="#">Sub-item 1</a></li> <li><a href="#">Sub-item 2</a></li> One more question. Is it possible that the menu tree would open when a click a subcategory, like it normally does? 1 Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted March 11, 2012 Share Posted March 11, 2012 Glad it worked for you! I also see you found a way to add subcategories. If you plan to have a bunch of categories/subcategories this is going to be a lot of manual entry work for you. I hope you created the folders like I mentioned above or all your hard work will be lost when/if you upgrade your PS. I think an easier way to remove the 'no_image' images would've been to simply comment out that section of the code (or remove if you prefer) or create your own custom 'no_image' graphic (with your logo or something). Marty Shue Link to comment Share on other sites More sharing options...
amnesiak Posted March 11, 2012 Author Share Posted March 11, 2012 Yes it would be much easier to comment out the no_images, but I have categories that I want to show images and those without images, which I want to show as a list. As I don`t know the solution for that, I used custom links. Also would it be Is possible that the menu tree would open when a click a subcategory, like it normally does? I appreciate your help. Link to comment Share on other sites More sharing options...
glennlawre Posted September 14, 2012 Share Posted September 14, 2012 Also would it be Is possible that the menu tree would open when a click a subcategory, like it normally does? I appreciate your help. amnesiak, did you ever manage to get this fixed? I have the same issue! Thanks... Link to comment Share on other sites More sharing options...
bhawin91 Posted June 25, 2015 Share Posted June 25, 2015 can anyone respond to my case please I have a category and subcategories under it i want to add a custom link to the end of the subcategory Link to comment Share on other sites More sharing options...
bhawin91 Posted June 25, 2015 Share Posted June 25, 2015 can anyone respond to my case please I have a category and subcategories under it i want to add a custom link to the end of the subcategory Link to comment Share on other sites More sharing options...
vekia Posted June 25, 2015 Share Posted June 25, 2015 do you use custom theme or default one? also you're reffering to default block categories module? Link to comment Share on other sites More sharing options...
bhawin91 Posted July 1, 2015 Share Posted July 1, 2015 The categories are displayed through a loop so if you hard code a link it will not be included in the loop. To add a link just open modules/blockcategories/blockcategories.tpl and add your link either immediately after the opening <ul> or immediately before the closing </ul>. You will need to add your link as a list item. <li><a href="http://www.yourlinkhere.com">Your Link Text</a></li> Remember to create a modules folder in your theme and in that folder create a folder named blockcategories. Copy the blockcategories.tpl file into this folder so your custom link will not be erased when you upgrade. Hope that helps! Marty Shue thats a good trick , but can you tell me how to add a custom link as a subcategory of category Here is another question.. how to add a custom link as a subcategory of a category? Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted July 1, 2015 Share Posted July 1, 2015 thats a good trick , but can you tell me how to add a custom link as a subcategory of category Here is another question.. how to add a custom link as a subcategory of a category? This is not very hard. Please see the post above on how to do it. Here is part of the post that will help you -- I found a way for subcategories: <li class="submenu"><a href="#">Link with drop-down</a> <ul> <li><a href="#">Sub-item 1</a></li> <li><a href="#">Sub-item 2</a></li> Hope that helps! Marty Shue Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now