Open a section page in client code

Hi Community,

Any idea how can I open a section in client code?

Like 0

Like

2 comments

You'll use PushHistoryState to navigate to a section in client code. The following will go to the Contacts section: 

this.sandbox.publish("PushHistoryState", {hash: "SectionModuleV2/ContactSectionV2"});

The "hash" parameter is what appears after the ViewModule.aspx# in the url. 

Ryan

Dear Fulgen,

You can achieve such task in two ways. The first one is described by Ryan. This is an elegant and easy way to manipulate navigation.

Other approach is to use window.location.assign method https://webplatform.github.io/docs/apis/location/assign/ using relative or full path to the page. This approach will save browser history.

Regards,

Anastasia

Show all comments