views:

213

answers:

1

I've created a list called Newsletters (columns: Title, Date and News - a multi lookup to a News list), and a DataFormWebPart displaying an item from this list. Now I'm modifing the XSLT transformation to change the displayed view.

At the moment an item is simply displayed with its Title, Date and News attributes, where News attribute is displayed as a list of News items titles - this is the default. Instead of the titles, I would like to also display these news' Content. The problem is that I have no idea how to get to these elements. The News attribute is being referred in xslt simply as <xsl:value-of select="@News"/> and I can't get to the elements that lie behind it.

Any suggestions on how I can do it?

A: 

You can do this using JavaScript and SharePoint web services.

First, to know how to use JavaScript and SharePoint web services refer to this post

Second, you have 2 scenarios,

  1. If your News' Titles are unique. Get the the contents of the multi-lookup HTML cell in your display page using JavaScript. Split the values into an array. Foreach array element get the corresponding list item in the News List (using JS and SP web services)
  2. If the News' Titles are not unique, you have to get the value of the multi-lookup field using the web services first which will be in this format (ID1;#Title1;ID2;#Title2...) . Extract the IDs and once again use the web services to get the corresponding News' List-Items

Third, Foreach News' List-Item Display the contents in any format you like

AbuShokry
"refer to this post" - should there be a link? could you provide any sources (links?) - that would be very useful as I'm absolutely new to sharepoint and i'm not sure i know what you're talking about
agnieszka
Ops, Sorry, Now the word "post" contains a hyperlink
AbuShokry