14
@DNNCon Don’t forget to include #DNNCon in your tweets! Creating URL Providers for Your Custom Extensions Brian Dukes, Engage @BrianDukes

Creating URL Providers for your Custom Extensions

Embed Size (px)

DESCRIPTION

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.

Citation preview

Page 1: Creating URL Providers for your Custom Extensions

@DNNConDon’t forget to include #DNNCon in your tweets!

Creating URL Providers for Your Custom Extensions

Brian Dukes, Engage@BrianDukes

Page 2: Creating URL Providers for your Custom Extensions

@DNNConDon’t forget to include #DNNCon in your tweets!

• Extension URL Provider

What It Is

Page 3: Creating URL Providers for your Custom Extensions

@DNNConDon’t forget to include #DNNCon in your tweets!

• DNN 7.1• Advanced URL Provider

How it works – Prerequisites

Page 4: Creating URL Providers for your Custom Extensions

@DNNConDon’t forget to include #DNNCon in your tweets!

• Just a component in a package• Optionally tied to a desktop

module• Managed through Site Settings

How it works – Install & Manage

Page 5: Creating URL Providers for your Custom Extensions

@DNNConDon’t forget to include #DNNCon in your tweets!

• Rearrange parameters?• Remove page names?• Implement redirects?• Store derived URL path

components?

Write Your Own – Plan

Page 6: Creating URL Providers for your Custom Extensions

@DNNConDon’t forget to include #DNNCon in your tweets!

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

Write Your Own – Manifest

Page 7: Creating URL Providers for your Custom Extensions

@DNNConDon’t forget to include #DNNCon in your tweets!

• IExtensionUrlProviderSettingsControl• Provider• void LoadSettings()• Dictionary<string, string>

SaveSettings()

• Validation bug

Write Your Own – Settings

Page 8: Creating URL Providers for your Custom Extensions

@DNNConDon’t forget to include #DNNCon in your tweets!

• Override ExtensionUrlProvider (in DotNetNuke.Entities.Urls)• CheckForRedirect• ChangeFriendlyUrl• TransformFriendlyUrlToQueryString• GetProviderPortalSettings• AlwaysUseDnnPagePath• AlwaysCallForRewrite *

Write Your Own – Implement

Page 9: Creating URL Providers for your Custom Extensions

@DNNConDon’t forget to include #DNNCon in your tweets!

• ProviderConfig• CleanNameForUrl( string, FriendlyUrlOptions)

• EnsureLeadingChar(string, string)

• EnsureNotLeadingChar( string, string)

• CreateQueryStringFromParameters( string[], int)

Write Your Own – Utilities

Page 10: Creating URL Providers for your Custom Extensions

@DNNConDon’t forget to include #DNNCon in your tweets!

• ChangeFriendlyUrl• Make generated URLs friendlier• Called from NavigateURL, EditUrl,

etc.• Look for URL parameters, convert

them to new path

Write Your Own – Replace

Page 11: Creating URL Providers for your Custom Extensions

@DNNConDon’t forget to include #DNNCon in your tweets!

• 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

Write Your Own – Rewrite

Page 12: Creating URL Providers for your Custom Extensions

@DNNConDon’t forget to include #DNNCon in your tweets!

• CheckForRedirect• Determine if incoming URL is in an

old format• Set new location

Write Your Own – Redirect

Page 13: Creating URL Providers for your Custom Extensions

@DNNConDon’t forget to include #DNNCon in your tweets!

• Turn on debug mode• AUM_AllowDebugCode

• Request with HTTP__FUGDEBUG• View messages in Fiddler

Tip – Debugging

Page 14: Creating URL Providers for your Custom Extensions

@DNNConDon’t forget to include #DNNCon in your tweets!

THANKS TO ALL OF OUR GENEROUS SPONSORS!