Hi Guys,
I need to create a one page website but still using the back-end content structure.
I remember in the old XSLT approach, there was a method to render an entire page together with it's template.
Is that still available in Razor?
Anybody can point me in the right direction?
I would prefer to use Razor with Master pages.
To be completely honest, I don't exactly know the difference from MVC.
We are using 7.2.* and we have started the development using Fanoe starter kit with the Grid.
I did something likes this using v7 and Razor/MVC. I created a main Home page and I use that for my site "settings" as well. One of these settings was a Multi-Node Content Picker. I used this to "pick" the pages that I wanted to use to make up my main single page site. I actually referred to these pages as "panels" but they're just a DocType with a Template and node, like any other page. Then on my HomePage.cshmtl template I hate the following code to render these "panels".
@{
// This code gets the selected content nodes and then creates a List of IPublishedContent items.
var nodeIds = Model.Content.GetPropertyValue
No problem. I also do a similar loop in a partial view to build the navigation and instead of using the URL I add #Model.Name and inside all my "panel" templates I have an and this allows my main nav to jump to the sections. Then use some sort of js to make it scroll smooth etc.
One page website
Hi Guys, I need to create a one page website but still using the back-end content structure. I remember in the old XSLT approach, there was a method to render an entire page together with it's template. Is that still available in Razor? Anybody can point me in the right direction?
Thanks, Adrian
Hi Adrian,
You can still use XSLT for rendering HTML. You need to create XSLT file, then create macro and use it in your master template or view.
What do you prefer MVC or ASP master pages ? .master or cshtml?
Thanks, Alex
Hi Alex,
I would prefer to use Razor with Master pages. To be completely honest, I don't exactly know the difference from MVC. We are using 7.2.* and we have started the development using Fanoe starter kit with the Grid.
I hope this makes sense.
Thanks, Adrian
Hi Adrian,
I did something likes this using v7 and Razor/MVC. I created a main Home page and I use that for my site "settings" as well. One of these settings was a Multi-Node Content Picker. I used this to "pick" the pages that I wanted to use to make up my main single page site. I actually referred to these pages as "panels" but they're just a DocType with a Template and node, like any other page. Then on my HomePage.cshmtl template I hate the following code to render these "panels".
Hope that makes sense. Phill
Thank you very much Phill, That's exactly what I was looking for. Kudos!
No problem. I also do a similar loop in a partial view to build the navigation and instead of using the URL I add #Model.Name and inside all my "panel" templates I have an and this allows my main nav to jump to the sections. Then use some sort of js to make it scroll smooth etc.
Phill.
is working on a reply...