function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Venkat DodlaVenkat Dodla 

convert an Article URL into clickable Article Title

I have a question on how to convert an Article URL mentioned below to that of the Article Title as an hyperlink. 
Article URL: https://Domain/lightning/r/Knowledge__kav/kA0SKWN0005WoRKAU/view (https://urldefense.proofpoint.com/v2/url?u=https-3A__BaseURL_lightning_r_Knowledge-5F-5Fkav_kA0SKWN0005WoRKAU_view&d=DwQFaQ&c=WlnXFIBCT3pmNh_w8hYeLw&r=j5d5-cF1KHg1HqDDS_kuy_27r5YVKNvDb545SWhOoJw&m=ssyyfr7pp8xSSZoYxuFGeXE0g40TQU6-th9aw-YHHS0&s=mRxSl0Iecr5_QkxM-Cf1XAdlzVxBKDnOF61-7NX-66s&e=" style="color:blue; text-decoration:underline)
I have a lightning button (code shared below) when clicked will copy the above URL so that the user can share the URL with their co-workers. I had completed achieving until here.
What I am looking currently is, to find out a way to copy the Article Title as a hyperlink that way user can share the Article title in an email which is readable. Once user click on the Title hyperlink, it will route the user to the online published version of the Article as mentioned above. 

I have went through below links in-order to find way and placed my findings at end of each link:
1) https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_str_link (https://urldefense.proofpoint.com/v2/url?u=https-3A__www.w3schools.com_jsref_tryit.asp-3Ffilename-3Dtryjsref-5Fstr-5Flink&d=DwQFaQ&c=WlnXFIBCT3pmNh_w8hYeLw&r=j5d5-cF1KHg1HqDDS_kuy_27r5YVKNvDb545SWhOoJw&m=ssyyfr7pp8xSSZoYxuFGeXE0g40TQU6-th9aw-YHHS0&s=wzJR3EH4F2S3PvVgNTl78hWV_iB9d7fSGYI2FWuNnEw&e=" style="color:blue; text-decoration:underline)  (This is exactly what I looking for but the str.link function is not working in Controller JS and this is how it is performing: <a href="https://BaseURL/lightning/r/Knowledge__kav/kA0SKWN0005WoRKAU/view">Test (https://urldefense.proofpoint.com/v2/url?u=https-3A__BaseURL_lightning_r_Knowledge-5F-5Fkav_kA0SKWN0005WoRKAU_view-2522-253ETest&d=DwQFaQ&c=WlnXFIBCT3pmNh_w8hYeLw&r=j5d5-cF1KHg1HqDDS_kuy_27r5YVKNvDb545SWhOoJw&m=ssyyfr7pp8xSSZoYxuFGeXE0g40TQU6-th9aw-YHHS0&s=nrVk3r4xYrLZh4b3OiH9CrCp0aNNZoAUuUzva0W6vpo&e=" style="color:blue; text-decoration:underline) Copy URL</a>)
2) https://developer.salesforce.com/docs/component-library/bundle/lightning:formattedUrl/documentation (https://urldefense.proofpoint.com/v2/url?u=https-3A__developer.salesforce.com_docs_component-2Dlibrary_bundle_lightning-3AformattedUrl_documentation&d=DwQFaQ&c=WlnXFIBCT3pmNh_w8hYeLw&r=j5d5-cF1KHg1HqDDS_kuy_27r5YVKNvDb545SWhOoJw&m=ssyyfr7pp8xSSZoYxuFGeXE0g40TQU6-th9aw-YHHS0&s=fO9NR3Alr9xfI9WwJ3x1UEr0RNjmpk9t6BL7umkyXXQ&e=" style="color:blue; text-decoration:underline) (I am able to convert the Article title as hyperlink  like <lightning:formattedUrl value="https://salesforce.com" (https://urldefense.proofpoint.com/v2/url?u=https-3A__salesforce.com-2522&d=DwQFaQ&c=WlnXFIBCT3pmNh_w8hYeLw&r=j5d5-cF1KHg1HqDDS_kuy_27r5YVKNvDb545SWhOoJw&m=ssyyfr7pp8xSSZoYxuFGeXE0g40TQU6-th9aw-YHHS0&s=78FXqRq7qB4a7YtbHCCG8z549HFUyp1z5pAB5DH0Q8c&e=" style="color:blue; text-decoration:underline) label="{!articleTitle}"/> but this is showing as title on Article page. I do not want to display it rather want to read the hyperlink value and pass it over to Controller JS that way I can pass it over the Helper.JS)
3) Also tried using record.linkName = '/'+record.Id; from the following link but no luck : https://www.infallibletechie.com/2018/07/how-to-hyperlink-record-in.html (https://urldefense.proofpoint.com/v2/url?u=https-3A__www.infallibletechie.com_2018_07_how-2Dto-2Dhyperlink-2Drecord-2Din.html&d=DwQFaQ&c=WlnXFIBCT3pmNh_w8hYeLw&r=j5d5-cF1KHg1HqDDS_kuy_27r5YVKNvDb545SWhOoJw&m=ssyyfr7pp8xSSZoYxuFGeXE0g40TQU6-th9aw-YHHS0&s=Cr8BdtbFwdsMPW6hyIWjR0Y1IoFPxJxpdAvK84BHQx0&e=" style="color:blue; text-decoration:underline)
Here is the code that I have so far:
Component.cmp:
            <div>
                <!-- Create Copy URL button-->
                <lightning:button onclick="{!c.copyArticleURL}" label="Copy Shortcut">
                </lightning:button>
            </div>
Controller.js:
    copyArticleURL: function(cmp, event, helper){
        var url = location.href;  // entire url including querystring
        var baseURL = url.substring(0, url.indexOf('/', 14));

        var action = cmp.get("c.getVersionID_CopyURL");
            action.setParams({"articleId":cmp.get("v.recordId"),});
            action.setCallback(this,function(response){
            var state = response.getState();
            var cntlrResponse=response.getReturnValue();
            var ArtOnlineVersionID = cntlrResponse.KnowledgeArticleId;
            var copyURL = baseURL + "/lightning/r/Knowledge__kav/"+ArtOnlineVersionID+"/view";
             helper.copyTextHelper(cmp,event,copyURL);
        });
          $A.enqueueAction(action); 
    },
Helper.JS:
    copyTextHelper : function(component,event,text) {
        // Create an hidden input
        var hiddenInput = document.createElement("input");
        // passed text into the input
        hiddenInput.setAttribute("value", text);
        // Append the hiddenInput input to the body
        document.body.appendChild(hiddenInput);
        // select the content
        hiddenInput.select();
        // Execute the copy command
        document.execCommand("copy");
        // Remove the input from the body after copy text
        document.body.removeChild(hiddenInput); 
},
APEX Class:
Public static Knowledge__kav getVersionID_CopyURL(String articleId)
    {
        Knowledge__kav KA = new Knowledge__kav();
        if(articleId!=null)
        {
            for(Knowledge__kav kv1:[select Id,Title,KnowledgeArticleID from Knowledge__kav where Id =:articleId limit 1])
                KA = Kv1;
        }
        return KA;  
    }
Kindly share your thoughts if you have it. Appreciate your help and support.