Saturday, May 30, 2015

Make a new page in DotNetNuke!

  1. Strictly speaking, the .ascx which populates a page (comprises its guts) is not a part of the page itself. This piece is a module. Let's assume our new page is to have a new module though. Making both a new page and a new module is a bit more painful than just making a page standalone as there seems to be an assumption that in most circumstances administrators will just use the baked-in canned modules, but, doing things the hard way, the first step is to just make a new web user control in Visual Studio. Look at what the others inherit from at their code behinds and mimic this.
  2. The packages in a .dnn file are an important wireup for a page/module pairing. Copy and paste an existing entry into the file and then doctor it up to reference your .ascx at controlSrc. (There should be one module control in moduleControls and it should not define a controlKey, i.e. have an XML tag which just closes, and should have "View" as the controlType.)
  3. Make sure your templates are up to date from source control. In the root of your application folder there will be a "Portals" folder which will have a folder inside of it of your naming (er, your company's naming) which has your templates.
  4. Log in as host at the application.
  5. Make sure the templates are up to date within the application itself. Click the "admin" link at the ribbon at the top of the app and then the "Site Settings" icon on the page full of icons which appears. Finally, click the "Update" link at the very base of the "Site Settings" page which appears.
  6. Go back to the page full of icons and click on "Pages" instead of "Site Settings" this time. Make a page here.
  7. Edit Internal.sitemap back in Visual Studio to get the page to appear in the menu system.
  8. Visit your new page. From the arrow at the upper left (assuming you're logged in as "host") expand the menu and pick "Delete" to delete the default module. You will next add your module here.
  9. Click the "host" link at the ribbon at the top of the application and then click the "Portals" icon. You need to export the portal templates from here. As I type this I cannot really remember exactly how to do so. It looks like you may do so in an onesies and twosies way with the "Export Portal Template" option from the menu that expands from the arrow at the upper left.
  10. Commit to source control anew.

Addendum 7/12/2015: I believe "Module Definitions" will let you update templates. I have following notes on "Module Definitions" with regards to adding a module:

  1. Edit the .dnn file to add a module.
  2. Change the version number at the top of the .dnn file.
  3. Log in as host.
  4. Click the "Host" link at the top navigation and then the "Module Definitions" icon.
  5. Pick "Create New Module" from the menu that comes from that downward pointing arrow at the upper left.
  6. "Create Module From:" should be set to "Mainfest" and some of the other dropdowns should be comparably set to allow you to select your .dnn file.

Addendum 7/14/2015: "Module Definitions" will NOT let you update the templates. After you add a module, add it to a page to flip the No to a Yes for the line item at the list at Module Definitions. Make sure your new page isn't already in the sitemap in the wrong place too when trying to add a page to the sitemap.

Addendum 7/16/2015: Remember to click the "Include Content" checkbox when exporting a template.

No comments:

Post a Comment