Display a SharePoint search box on a publishing website

The page on our MOSS publication site has a property that is a search field.

I want the selected text to appear when you view the page not in edit mode, but when I use it Microsoft.SharePoint.WebControls.LookupField, it generates a hyperlink to the SharePoint list item (obviously, bad).

Is there any way around this without creating my own search field control?

+3
source share
3 answers

You can use jQuery hack

Using jQuery to remove hyperlinks from Linked List Items.

<script type="text/javascript" src="/jquery-1.3.1.js"></script>

<script type="text/javascript">
$(document).ready(function() {
   $('a[href*="RootFolder=*"]').each(
      function(index) {
         var link = $(this);
         $(this).after("<span>" + link.text() + "</span>");
         $(this).remove();
      });
});
</script>
+2
source

. , , - .

0

,

displaytemplate.ascx,

SharePoint: RenderingTemplate ID = "LookupDisplayTemplate" runat = "server" >     & & BLOCKQUOTE ; >         & blockquote & SharePoint: FieldValue = "FieldValue1" runat = "server" ControlMode = "" /" >     & & BLOCKQUOTE ;/ >   & & BLOCKQUOTE ; /SharePoint: RenderingTemplate >

Then. use it as shown below.

& blockquote & SharePoint: LookupField id = "LookupField1" FieldName = "" runat = "server" DisplayTemplateName = "LookupDisplayTemplate" / ">

Then it works.

Hope this helps :)

Whispers

0
source

Source: https://habr.com/ru/post/1704556/


All Articles