Reputation: 103
I am a .net developer learning DNN and wanted to know how I can make reusable code for my skins. What I would like to do is have the header and footer sections created in a file (like a masterpage) and then create my skin I will use for the website bringing in the header/footer file and adding to it ( like a nested master page). Is there a way to do this when skinning ? I am trying to prevent making a Home page skin and a skin for the rest of the website. Where the header and the footer parts are always the same for the home page and the website.
One if the biggest things is that I do not want to have to make changes in multiple places.
Any suggestions on how to do this ?
Upvotes: 0
Views: 236
Reputation: 155915
You can add controls that you reference from multiple skins. Take a look at my answer at https://stackoverflow.com/a/10518931/2688 for fuller details.
Upvotes: 1
Reputation: 2213
When you create the skin for DNN, essentially you are creating a "master page", so to speak. So, when you do create your 'skin', when you layout your page, you're really using just one skin layout for your whole site.
If your home page differs from the rest your content pages, you don't need to create two whole skins, but you do need to make two layouts. The difference will be in the midsection of your content. Your one skin will have two HTML files that will convert into two .ascx files when your skin is parsed and included in to your portal (if you're creating your skin through HTML. If you're doing straight .ascx, then you'll layout two .ascx files).
It's all in how you layout the ContentPane pane, which must be in your layouts. For your home page, it will be in a different spot then in content pages. For example, if your home page has a rotator below the header and a single section without a sidebar so content is full width, then a footer below, then your ContentPane will be in the middle at full width.
Then, your content pages may have the same header and footer, but a sidebar on the left or right (or both, which you can do on a single content page and not have them both show unless you use them). So then you layout the page to have a ContentPane be floated left(or right) and have the sidebar float right(or left).
Basically, you're using the same workflow to layout a static site, but keeping in mind that content panes will be used based on positioning of content.
May I suggest you listen to some of the DotNetNuke videos that Chris Hammond does from DotNetNuke. They are done in full-blown detail and step you through every facet of skinning, from HTML simple with adding tokens, to straight .ascx and using registers.
Upvotes: 0