R – Change pictures on a Masterpage depending on documents in Document Library

documentmaster-pagessharepoint

I have to display a picture with a link on the masterpage of a sharepoint site. I also have a document library with a custom field named status. When in the library exists a document with the status "Active" the picture should be red with the link pointing to the document. When there is no Active document the picture should be blue and pointing to the library. Any ideas???

Best Answer

You could inline a content query or DataView webpart. Export the content query webpart to override the link to the xslt. You will need to create your own xslt file (my preference) or add a new style to the existing one.

Xslt is flexible enough to determine if there is an "active" document in the list and the html it displays can then be completely different.

For starters:

http://msdn.microsoft.com/en-us/library/bb850574.aspx

http://msdn.microsoft.com/en-us/library/bb447557.aspx