0

We have a sharepoint2013 web application with one site collection, one top level "http://spta" and some subsites(e.g http://spta/aboutus) in the top level there is a Publishing image library with "Keyword" column.

  • Image1.jpg Keyword:aboutus,contactus,....
  • Image2.jpg keyword:conferences,aboutus,...
  • ...

Now I want to show all images with "aboutus" keyword in "aboutus" subsite. and I know how to do that, but I want to display only one image each day.

0

I can't think of any out of the box solution. You need to create a Custom WebPart to do this.

  1. Create a Visual Webpart - Add an Image Control
  2. Get current URL
  3. Now read images from Picture Library into an array

Logic to rotate

We need to store current image information as well as the date that image was set. We can use web property bag for this.

On first page load, set the image control to the first image. Then store the image ID and current date time into web property bag

For subsequent page load, read date time value from property bag. Now compare with current time. If more than 24 hours difference, then read image with next ID, set image to control and store current date time into web property bag.

  • how about using <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/> to filter data view ,but I need to have day number – Melika May 28 '15 at 20:39
  • You can try that, but I believe in that case you need to populate current date values in the image properties? – Amal Hashim May 28 '15 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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