To make the views accessible through URL first follow the standard creation process...
Create a new view using FAB on the views panel.
In the view configuration enter a view name.
Create and or select a template file.
For this tutorial we have set up two example views, see: View 1, View 2. As seen in the example above we've made two views with the routes view1/.* and view2/.*.
To generate the URL we'll use Link.To(parameters: ...) which will build the url from the specified parameters.
@inherits Custom.Hybrid.Razor14
<h3>Make URL pointing to view</h3>
@{
// We often want to preserve current url-params
// For the tutorial it's essential, otherwise the Tutorial doesn't know where we are
var urlParams = CmsContext.Page.Parameters;
var view1Parameters = urlParams.Set("view1", "whatever");
var view2Parameters = urlParams.Set("view2", "nice");
}
<p>
Link to view1
<a href='@Link.To(parameters: view1Parameters)'>
@Link.To(parameters: view1Parameters)
</a>
</p>
<p>
Link to view2
<a href='@Link.To(parameters: view2Parameters)'>
@Link.To(parameters: view2Parameters)
</a>
</p>