Skip to main content
cbeac2432
Contributor ⭐️⭐️⭐️
June 6, 2021
Solved

Make a Regular Category a Custom Link

  • June 6, 2021
  • 7 replies
  • 183 views

I would like to make a category within a parent category a custom link (like we can already do with parent categories using the customize button in the live environment.)

 

Best answer by Jeanie Lee

@cbeac2432 I believe I’m starting to understand. 🙂 It’s not possible to have a custom link appear in the dropdown menu of a parent category. At the moment, custom links can only be added to the mega menu (without a dropdown) 

However, I can provide a workaround. Try to create a child category and then force a redirect with a TPS script:

<script>
if (window.location.href == 'KB category url') {
window.location = "the custom link url"
}
</script>

When the user clicks on that category in the menu, it will take them to the custom link he wants.

 

If this is helpful, feel free to mark it as the best answer! :) 

7 replies

Jeanie Lee
Helper ⭐️⭐️⭐️
June 7, 2021

cbeac, 

You should be able to add a custom link by following the loom video below. Did you hit any roadblocks trying to add the link? The original category will still appear in the parent category’s drop down menu; however, you can just add a custom link in the mega menu for more visibility. 

 

 

cbeac2432
cbeac2432Author
Contributor ⭐️⭐️⭐️
June 7, 2021

@Jeanie Lee I know how to do this with parent categories but not with the categories within parent categories.

Jeanie Lee
Helper ⭐️⭐️⭐️
June 8, 2021

If you follow the steps in the video above to insert a custom link, does the link not appear? I would insert the URL of the category page. 

cbeac2432
cbeac2432Author
Contributor ⭐️⭐️⭐️
June 8, 2021

I want the link to be in the dropdown from the parent category. Not the parent category itself. 

Jeanie Lee
Helper ⭐️⭐️⭐️
June 8, 2021

@cbeac2432 I believe I’m starting to understand. 🙂 It’s not possible to have a custom link appear in the dropdown menu of a parent category. At the moment, custom links can only be added to the mega menu (without a dropdown) 

However, I can provide a workaround. Try to create a child category and then force a redirect with a TPS script:

<script>
if (window.location.href == 'KB category url') {
window.location = "the custom link url"
}
</script>

When the user clicks on that category in the menu, it will take them to the custom link he wants.

 

If this is helpful, feel free to mark it as the best answer! :) 

cbeac2432
cbeac2432Author
Contributor ⭐️⭐️⭐️
June 10, 2021

Try to create a child category and then force a redirect with a TPS script:

<script>
if (window.location.href == 'KB category url') {
window.location = "the custom link url"
}
</script>

 

Hey @Jeanie Lee Where do input this script?

Blastoise186
Helper ⭐️⭐️⭐️
June 11, 2021

Hi.

You’ll need to put this under the Third-Party Scripts section in Customisation, which is available via Control → Customization → Third-Party Scripts. You’ll need to be logged in as an Administrator to do this as it’s locked out from all other roles by default for security reasons. It’s recommended to test this on Staging first to make sure it’s working as expected.

There’s some more info at this thread, just in case you get stuck.

 

Bug blasting absolutely everything... The Blastoise Way