Christophe from PathToSharePoint offers the possibility to generate your own script for an image rotator. You can copy the script and add it to a CEWP on your page.
This is a great service.
But there is only the possibility to add a hyperlink that will download the picture directly, or will open a link that is specified in an extra text column that you should fill out by hand. Instead I want the dispform to be opened with the properties of the picture.
The script uses "/_vti_bin/owssvr.dll?Cmd=Display&XMLDATA=TRUE&List={GUID}" to query the picture library and get a XML output in return. And here is where the restrictions come in: this data doesn't contain the ID of the picture, only the name. And it calls the default view of the picture library that probably will have an item limit, so not all images are rotated.
Therefore I rewrote the script a bit to get it work my way.
First add an All items view to the picture library, and name it xxx or something so users will not be motivated to select it. Get the GUID of this view and add it to the script: "/_vti_bin/owssvr.dll?Cmd=Display&XMLDATA=TRUE&List={GUID}&View={GUID}".
Second I will use the name of the picture to add it to a search query:
var LinkColumn="ows_NameOrTitle";var PictureLink="/SearchCenter/results.aspx?s=PicLib&k="+ListItems[SelectedItem].getAttribute(LinkColumn);
Add a scope to the search administration based on the web address of the picture library.
In this way I will find the picture, but still not have the possibility to open the dispform of the item.
So I will use the trick from SharePoint Search Results: Adding a link to the view properties page of a document to get the ID available in the search results and add a 'View properties' link with XSL.
Quod erat demonstrandum.
No comments:
Post a Comment