其實是有的,就是那個 galleryimages 的 plugins,它就可以使用檔案中心資料夾裡的圖片,來做放在首頁上的隨機照片。
底下是它的說明:
**************************************************************************
This plugin offers two methods, one for fetching the most recently uploaded image and another one for retrieving a random image from our collection. Needless to say, this plugin only returns images and not any other type of resource. Only images that belong to public albums will be used.
You can use the following snippet of template code to show the latest uploaded image in your templates:
{assign var=latestImage value=$galleryimages->latestImage()}
<a href="{$url->resourceLink($latestImage)}">
<img style="border:0px;" src="{$url->resourcePreviewLink($latestImage)}" alt="{$latestImage->getDescription()}" />
</a>
To show a random image from your collection, you can use the following snippet:
{assign var=randomImage value=$galleryimages->randomImage(9)}
<a href="{$url->resourceLink($randomImage)}">
<img style="border:0px;" src="{$url->resourcePreviewLink($randomImage)}" alt="{$randomImage->getDescription()}" />
</a>
And, you can use
{$galleryimages->randomImage(8)} to get 1 random image from album id=8, or use
{$galleryimages->randomImage(10,3)} to get the 3 random images from album id=10
Or, you also can use
{$galleryimages->lastImage(8)} to get last 1 upload image from album id=8, or use
{$galleryimages->lastImage(10,3)} to get last 3 upload images from album id=10
**************************************************************************
目前我個人是使用 randomImage 的方式,但只能顯示一張,
>{$galleryimages->randomImage(10,3)} to get the 3 random images from album id=10
至於這行的意思,不曉得是否表示可以顯示三張?則不得而知,因為我試不出來,總是只顯示一張而已。