Search code examples
dotnetnuke2sxc

Is there a way to output DNN pages to the page via a 2sxc app using C# Razor template?


I want to set up a 2sxc app that handles the DNN menu instead of using DDR Menu. So the template would grab the pages as on the Pages part of DNN and render them on the page just like a DDR Menu template would. However, I would be able to template my own structure.

The reason why I want to do this is so that I can make a maximally editable header that includes a mega menu with content other than typical pages in DNN. Is this even possible? If so, how? What would the C# Razor code be?


Solution

  • all is possible, the only question is how complex it will be.

    One option is to use the DNN APIs to get the data. You could look at the DDR code to find out how it's done

    Another option is to use a Visual Query with the Pages data source. https://docs.2sxc.org/api/dot-net/ToSic.Sxc.DataSources.Pages.html which was added ca. 2sxc 12. So far it's only used in the page-picker in the edit-dialog, so it may not be feature complete. But I would personally start there.