Currently working on a site in Sharepoint 2013, I have created a custom item display template to display links to related pages across the site on a page via the content search webpart. The items are set to use a publishing hyperlink field for the user to add a page url for the item to link off to when the item is clicked. The html for the template is structured as follows:
<div class="training-link"> <a href="_#= _linkUrl =#_"> <h3>_#= _title =#_</h3> </a> </div>
Unfortunately when I attempt to grab that field value via the publishing hyperlink managed property, the webpart renders like so:
<div class="training-link"> <a href="<a href=" sites="" deed-ui="" pages="" mass-layoff- archives.aspx"="" target="_blank">Mass-Layoff-Archives.aspx</a>"> <h3>Test Link 3</h3> </div>
For reference, the value input for the publishing hyperlink field for the above item was:
I want to be able to grab only the information entered into that field of the item and set it as the href for the item. Unsure as to why the display template interprets the field value in such a strange way. Any help for how to troubleshoot is appreciated.