This is a follow up to this question.

I have created an announcements list (built in type). I want to be able to categories an announcement. i.e. Soccer, Football, Golf.

I also want to display an image depending on the category.

My initial thinking was to create a custom list; Announcement Category. Where the title was the category name. I would then a file column. I can't do this as file is not a column type. So instead I am adding a Hyperlink or Picture column. I can then reference an image.

When I add a Lookup (information already on this site) column. I have pointed this to Announcement Category. I can show the Title field of the list however I do not have the option to display the Hyperlink or Picture column.

I need the Hyperlink or Picture URL in the Announcement list as I am performing a custom xsl transformation on the xml to style it in a certain way.

I know I could put some logic in the XSL to display an image based on the title but it would not allow my end users to me able to change the Announcement Category image.

How can I best display an image for all particular types of an announcement?

2 Answers 2


I think that you can try to use this solution. In your case the user specifies an url in the new form to the picture. In XSL template you can use this url in image src attribute.

  • The only problem is I need to update the xsl every time they add a new news category. They can't take owenership themselves. May just do this wasted a bit too much time on this today. The other thing I though I could do is just create a custom web part and do it all myself.
    – John
    Commented Nov 3, 2011 at 15:18
  • 1
    Why? You can create Categories list, and use Lookup field in your list to categories. then you change a view of this fild like this: <img src="{$thisNode/@Url}"/> in this case user should specify category in categories list (set category name, and url to the picture). In news the user choose category.
    – Alexander
    Commented Nov 3, 2011 at 16:24
  • Alexander has the method I would employ.
    – websch01ar
    Commented Nov 3, 2011 at 17:47

Unfortunately, the hyperlink or picture isn't a default option when working with a Lookup. Your best option would probably be to create a data view that links the lists so you can access any of the fields and use your custom XSLT to make the translation from category to image. Marc Anderson (@sympmarc) has a blog post that should be able to get you started.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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