Hi,
You basically need to select multiple documents and use paging with page size equal to one, so that only one document is displayed at a time.
Since default
Random document webpart doesn't have pager control properties, you will need to modify its code to allow them or directly set them in codebehind. I would suggest to
clone the default webpart first before making changes.
In the cloned webpart code, (default one is at \CMSWebParts\Viewers\Documents\randomdocument.ascx.cs), in
SetupControl() method you can set the properties of the repeater's pager control like this:
...
repElem.Columns = Columns
// modification begin
// paging when more documents selected
repElem.EnablePaging = true;
repElem.PageSize = 1;
repElem.PagerControl.PagerPosition = CMS.Controls.PagingPlaceTypeEnum.Bottom;
repElem.PagerControl.ShowPageNumbers = false;
repElem.PagerControl.ShowFirstLast = false;
repElem.PagerControl.PagingMode = CMS.Controls.PagingModeTypeEnum.PostBack;
...
More details about this can be found at
http://devnet.kentico.com/docs/controls/datapager_overview.htmAs suggested, it would be better to use UniPager control. This example with DataPager is just for illustration, but works fine too..
Then in the webpart properties, please define "
Random N" property, which
"sets the number of random documents that should be selected, by default one random document is selected." You can specify any number, if there is not as many documents, it won't matter, however it's not wise to select any high number. Otherwise some better (more scalable) approach should be used.
Hope this helps.
--Zdenek