Community > Answers
170 views

Live Knowledgebase Compatibility with UrlAdapter (DnnSharp) possible?

First issue: When creating an article in the Live Knowledgebase extension, the HTML Editor for the article content does not show. That is beacuse LK expects the url to be in DNN Url Provider format (e.g. domain.com/page/sub-page/key/value/), and not in the format that Url Adapter uses (e.g. domain.com/page/sub-page?key=value). and because of that the resulting URL for the HTML Editor with Url Adapter installed is: domain.com/page/sub-page?ctl=DNN_Controls_HtmlEditor/mid/4516?popUp=true instead of domain.com/page/sub-page?ctl=DNN_Controls_HtmlEditor&mid=4516&popUp=true Note the "/"-es in the query string and the double "?". With the default DNN Url Provider the url would be: domain.com/page/sub-page/ctl/DNN_Controls_HtmlEditor/mid/4516?popUp=true which is a valid url for that provider. 

Second issue: When trying to decode the URL of the page, Url Adapter tries to identify as much as possible from the URL. And for things that it cannot identify, it calls the ExtensionUrlProvider, which is the default way of generating and rewriting friendly URLs from within an DNN Extension. For a page with Live Knowledgebase the method TransformFriendlyUrlToQueryString of the Mandeeps Url Library ExtensionUrlProvider is called like this: 

Page URL: domain.com/en-us/page/my-category - Url Adapter identifies that "domain.com/en-us/page" is a DNN Tab path (let's say the TabId is 58), but it does not know what "/my-category" stands for so the call to TransformFriendlyUrlToQueryString has the following 
parameters: 

urlParms: ["my-category"], tabId: 58, 
portalId: 0, (let's say the current portal has an Id of 0) 
options: <default options structure retrieved from DNN>, 
cultureCode: "en-US", (let's say the culture is en-us) 
portalAlias: <structure from DNN>, 

As the documentation for the ExtensionUrlProvider says (http://www.dnnsoftware.com/wiki/extension-url-providers#6f70029f-7584-4761-4db0-eb1ba1eca50d), the urlParams should be "a string array of the URL segments (/segment1/segment2) in the URL "after" the site alias & page path have been matched and removed from the entire URL. In this example, it would be an array of 1 position with 'My-Item' in it." (the example URL there was "/segment1/segment2/My-Item")

Saran Ramu Saran Ramu
asked 02/12/2018 22:35
Add Comment
Last Activity 02/15/2018 20:27

1 Answer(s)

  • answered 02/14/2018 01:53
    Mandeep Singh
    Add Comment
    Saran Ramu
    replied 02/15/2018 10:04

    The issue is that in your Custom Url Provider (ExtensionUrlProvider), the Mandeeps.DNN.Libraries.URL.Providers.URLProvider.TransformFriendlyUrlToQueryString method ignores all the requests that have a tabId != -1 and needs all the url parts passed in the urlParms parameter. As I said in the original question Url Adapter makes requests with valid tabId and the url parts after the pageName (as in the DNN documentation - see link in the original question).

    Example: URL: http://domain.com/en-us/page/my-category

    Your Custom Url Provider wants:
    urlParms: ["en-us", "page", "my-category"],
    tabId: -1, 
    portalId: 0,
    options: <default options structure retrieved from DNN>, 
    cultureCode: "en-US",
    portalAlias: <structure from DNN>

    Url Adapter calls TransformFriendlyUrlToQueryString with:
    urlParms: ["my-category"],
    tabId: 58, 
    portalId: 0,
    options: <default options structure retrieved from DNN>, 
    cultureCode: "en-US",
    portalAlias: <structure from DNN>

    I think that the your Url Provider should support calls with valid tabId.

    Mandeep Singh
    replied 02/15/2018 20:27

    Please open a support ticket with a use case and instructions to duplicate the issue (with DNN Sharp URL Adapter). We'll gladly update our URL Library to support the scenario. Thanks


    Reply
Add an Answer