function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tara HamondTara Hamond 

Napili Community Custom Component - How to navigate to topic using events?

I am building a custom lightning component for the Napili Community to replace the headline component that it uses by default. Similarly, the new headline will display the list of sub topics for the topic page that the user is currently on and allow them to navigate to those links.

I am using a click action with this function:
 
onClickTopic: function(component, event, helper) {
        var id = component.get("v.subtopic.TopicId");
        console.log("id: " + id);
        
        var urlEvent = $A.get("e.force:navigateToURL");
        urlEvent.setParams({ "url": "/" + id });
        
      urlEvent.fire();
    },

It fires the navigateToUrl event and passes the topic id in the url.  Weirdly, this always loads the license list view.  As I need it to load the topic, does anyone know what I'm doing wrong? I also tried the navigateToSObject event but wasn't able to get that working either. I'm sure that the community template has a built in event that I could fire but I can't find any documentation on it.

Thanks in advance for anyone who can assist!