Link to Detail XSLT

The Pages

We will make an ad-hoc “news archive” page, e.g: http://www.contoso.com/NewsArchive

(Make sure to replace the server name and port as well as the page name with your own.)

Figure 1: The News Archive page

When calling the NewsArchive function, you can see that its parameter (NewsDetailsPage) points to the “news details” page (via its ID).

<f:function name="Samples.News.NewsArchive" xmlns:f="http://www.composite.net/ns/function/1.0">
  <f:param name="NewsDetailsPage" value="4bab5861-9a34-478a-828c-f75dcdaf8729" />
</f:function>

Listing 1: Calling the NewsArchive function

Click the link for the news details - and the “news details” page will open as similar to:

http://www.contoso.com/NewsDetails?NewsID=e18873b2-0e0b-4041-92b6-4913892ac3bd&News=Higher%20interest%20rates

(Make sure to replace the server name and port as well as the page name with your own.)

Figure 2: The news details of one news element

On our “news details” page both functions are used: NewDetails and NewsLatest

<f:function name="Samples.News.NewsDetails" xmlns:f="http://www.composite.net/ns/function/1.0" />

Listing 2: Calling the NewDetails function

<f:function name=" Samples.News.NewsLatest" xmlns:f="http://www.composite.net/ns/function/1.0">
  <f:param name="PageSize" value="5" />
  <f:param name="NewsArchivePage" value="0c94fe9d-c1bf-467e-9918-e7d4b8a4d3ea" />
  <f:param name="NewsDetailsPage" value="4bab5861-9a34-478a-828c-f75dcdaf8729" />
</f:function>

Listing 3: Calling the NewsLatest function

The NewsLatest function is almost the same as NewsArchive but now it lists a fixed number of articles per category (maximum 5 in this sample):

Figure 3: The “News Details” article with NewsLatest underneath

Yes, we need a nicer link for this, based on a title without spaces or the like.

So you have a link like this: http://www.contoso.com/NewsArchive?Category=Business

Note: You must avoid duplicate news titles for this to work nicely.

Figure 4: Using the “Category” query string filter (done in XSLT in this case)