Hot answers tagged


It is feasible and you just need to expose the API. So, on your react component, you will have a button whereby you will bind it to a function. In that particular function, you can use Axio to call your endpoint (contact/submit). Then, it is pretty much straight forward. You need to implement the API and register it in Sitecore so that when the url mysite....


You need to pass the token (received in the first request) in the header like: xhr2.setRequestHeader('token', val);


Indeed, as @jammykam said, you should split the conditions in 2 different renderings and handling the visibility through rules engine. If you think that conditions are quite complex to be adapted for rules engine then split the functionality in 2 views. For other side, normally for dealing with ViewLocations on POST actions we create a custom dynamic route ...

Only top voted, non community-wiki answers of a minimum length are eligible