1

I am trying to find a way to display two columns from a list item, values in the both the columns are of type SPFieldUser. Looking for a way to display their contact card just like the way it is displayed in DispForm.aspx.

Appreciate any help!

1 Answer 1

1

I'm not sure if this will answer your question as you don't give a lot of detail of what you're trying to do, a custom solution, what language?

So, here's how to do it if you wrote a custom javascript web part, the HTML for the presence indicator would be the following:

(Replace currentsite and userId and userName with the appropriate values)

<span class="ms-noWrap">
   <span class="ms-spimn-presenceLink">
     <span class="ms-spimn-presenceWrapper ms-imnImg ms-spimn-imgSize-10x10">
       <img class="ms-spimn-img ms-spimn-presence-disconnected-10x10x32" 
    src="*currentsite*/_layouts/15/images/spimn.png?rev=23"  alt="" />
     </span>
   </span>
   <span class="ms-noWrap ms-imnSpan">
     <span class="ms-spimn-presenceLink">
       <img class="ms-hide" src="*currentsite*/_layouts/15/images/blank.gif?rev=23"  alt="" />
     </span>
     <a class="ms-subtleLink" onclick="GoToLinkOrDialogNewWindow(this);return false;" href="*currentsite*/_layouts/15/userdisp.aspx?ID=*userId*">*userName*</a>
   </span>
</span>
1
  • I am working on doing a custom webpart(visual) in C#, so server side code is fine with me. HTML tip as you mentioned could get me started.
    – UP26
    Jan 5, 2017 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.