Creating URL Providers for your Custom Extensions

1,714 views

Published on

With the integration of URL Master into DNN 7.1, the creation of module-specific URL providers will be a more common differentiator for DotNetNuke modules. We'll look at what it means to have amazing, customizable URLs for the dynamic content of your custom modules.

Published in: Technology, Design
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,714
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Creating URL Providers for your Custom Extensions

  1. 1. Creating URL Providers for Your Custom Extensions Brian Dukes, Engage @BrianDukes Don’t forget to include #DNNCon in your tweets! @DNNCon
  2. 2. What It Is • Extension URL Provider Don’t forget to include #DNNCon in your tweets! @DNNCon
  3. 3. How it works – Prerequisites • DNN 7.1 • Advanced URL Provider Don’t forget to include #DNNCon in your tweets! @DNNCon
  4. 4. How it works – Install & Manage • Just a component in a package • Optionally tied to a desktop module • Managed through Site Settings Don’t forget to include #DNNCon in your tweets! @DNNCon
  5. 5. Write Your Own – Plan • • • • Rearrange parameters? Remove page names? Implement redirects? Store derived URL path components? Don’t forget to include #DNNCon in your tweets! @DNNCon
  6. 6. Write Your Own – Manifest <component type="UrlProvider"> <urlProvider> <name>My URL Extension Provider</name> <type>My.Module.Url.UrlProvider</type> <settingsControlSrc>…</settingsControlSrc> <redirectAllUrls>true</redirectAllUrls> <replaceAllUrls>true</replaceAllUrls> <rewriteAllUrls>true</rewriteAllUrls> <desktopModule>My Module</desktopModule> </urlProvider> </component> Don’t forget to include #DNNCon in your tweets! @DNNCon
  7. 7. Write Your Own – Settings • IExtensionUrlProviderSettingsControl • • • Provider void LoadSettings() Dictionary<string, string> SaveSettings() • Validation bug Don’t forget to include #DNNCon in your tweets! @DNNCon
  8. 8. Write Your Own – Implement • Override ExtensionUrlProvider (in DotNetNuke.Entities.Urls) • • • • • • CheckForRedirect ChangeFriendlyUrl TransformFriendlyUrlToQueryString GetProviderPortalSettings AlwaysUseDnnPagePath AlwaysCallForRewrite * Don’t forget to include #DNNCon in your tweets! @DNNCon
  9. 9. Write Your Own – Utilities • ProviderConfig • CleanNameForUrl( string, FriendlyUrlOptions) • EnsureLeadingChar(string, string) • EnsureNotLeadingChar( string, string) • CreateQueryStringFromParameters( string[], int) Don’t forget to include #DNNCon in your tweets! @DNNCon
  10. 10. Write Your Own – Replace • ChangeFriendlyUrl • Make generated URLs friendlier • Called from NavigateURL, EditUrl, etc. • Look for URL parameters, convert them to new path Don’t forget to include #DNNCon in your tweets! @DNNCon
  11. 11. Write Your Own – Rewrite • TransformFriendlyUrlToQueryString • Convert incoming URL to standard query string format • May need to find matching DNN page • Match the root, turn the rest into regular query string Don’t forget to include #DNNCon in your tweets! @DNNCon
  12. 12. Write Your Own – Redirect • CheckForRedirect • Determine if incoming URL is in an old format • Set new location Don’t forget to include #DNNCon in your tweets! @DNNCon
  13. 13. Tip – Debugging • Turn on debug mode • AUM_AllowDebugCode • Request with HTTP__FUGDEBUG • View messages in Fiddler Don’t forget to include #DNNCon in your tweets! @DNNCon
  14. 14. THANKS TO ALL OF OUR GENEROUS SPONSORS! Don’t forget to include #DNNCon in your tweets! @DNNCon

×