Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Adrian Ursu 20 posts 51 karma points
    Feb 26, 2016 @ 11:38
    Adrian Ursu
    0

    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

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Feb 26, 2016 @ 16:10
    Alex Skrypnyk
    0

    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

  • Adrian Ursu 20 posts 51 karma points
    Feb 26, 2016 @ 17:13
    Adrian Ursu
    0

    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

  • Phill 115 posts 288 karma points
    Feb 26, 2016 @ 20:50
    Phill
    100

    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".

    
    @{
    // This code gets the selected content nodes and then creates a List of IPublishedContent items.
        var nodeIds = Model.Content.GetPropertyValue

    Hope that makes sense. Phill

  • Adrian Ursu 20 posts 51 karma points
    Feb 26, 2016 @ 21:26
    Adrian Ursu
    0

    Thank you very much Phill, That's exactly what I was looking for. Kudos!

  • Phill 115 posts 288 karma points
    Feb 26, 2016 @ 21:30
    Phill
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft