[WordPress] 外掛分享: NextGEN Gallery Sidebar Widget

首頁外掛目錄 › NextGEN Gallery Sidebar Widget
800+
安裝啟用
★★★★★
5/5 分(2 則評價)
5153 天前
最後更新
問題解決
WordPress 2.8+ v0.4.3 上架:2009-04-17

內容簡介

NextGEN widget 僅允許顯示單個圖像,因此我需要一個顯示到影集頁面的小工具。於是我編寫了這個小工具。您可以指定以下參數:

最大影集數量: 您想要顯示的影集數量
影集排序: 您可以選擇按隨機、按照添加日期升序或降序排列
影集縮略圖程式: 在側邊欄中使用哪個圖像作為縮略圖 (在 NGG 中預覽設置、第一個或隨機圖像)
AutoThumb 參數: 如果您安裝了 AutoThumb,則該插件將使用其功能將圖像調整為您需要的大小。在這裡使用如下字符串:w=80&h=80&zc=1 來顯示 80x80 的正方形縮略圖。
輸出寬度/高度: 如果您不使用 AutoThumb,該插件將設置 HTML 屬性寬度和高度。
默認鏈接 ID: 該小工具假定您為每個影集設置了頁面並將該影集鏈接到該頁面中 (您可以使用 NGG 相片庫編輯器完成此操作)。如果一個影集沒有設置鏈接,它將使用默認鏈接 (頁面或文章的 id)。
排除一些影集: 通過指定它們的 ID 作為逗號分隔列表來排除一些影集

全部的開發工作都在 GitHub 上完成。如果您有想法、增強功能等,請隨時複製該項目並發送一個 pull request。

如有任何問題,請使用 問題追蹤器。

模板:

從版本 0.3 開始,您可以通過模板完全控制小工具的輸出。由於內置模板將在每次插件更新時被覆蓋,請在您的主題目錄中創建一個名為 "ngg-sidebar-widget" 的新目錄,並將兩個模板文件 "tpl.outer.html" 和 "tpl.inner.html" 複製到該目錄中以進行編輯。外部模板只是一個包裝器模板 (當您需要一些額外的標記,例如創建列表時很有用),而內部模板可以訪問來自影集和圖像對象的所有值 (寫在簡單的模板語法中: {=object.member})。對於大多數用例,您只需要使用 "gallery.title"、"gallery.link" 和 "image.url"。

您將可以訪問以下變數:

gallery

gid
name
path
title
galdesc
pageid
previewpic
author
link

image

errmsg
error
imageURL
thumbURL
imagePath
thumbPath
href
thumbPrefix
thumbFolder
galleryid
pid
filename
description
alttext
imagedate
exclude
thumbcode
name
path
title
pageid
previewpic
permalink
post_id
sortorder
meta_data
gid
galdesc
author
imageHTML
thumbHTML
url
output_width
output_height
output_width_tag
output_height_tag

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.4.3) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「NextGEN Gallery Sidebar Widget」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

The NextGEN widgets only allow showing of single images, I needed a solution to show links to galleries, so I wrote this widget. You can specify the following parameters:

Maximum Galleries: the number of galleries you want to show
Gallery Order: you can select random, date added ascending or date added descending
Gallery Thumbnail: which image should be taken as thumbail in the sidebar (preview set in NGG, first or random image)
AutoThumb parameters: if you got AutoThumb installed, the widget will use its functions to resize the image to your needs. Use a string like w=80&h=80&zc=1 here to show 80×80 square thumbnails.
Output width/height: if you don’t use AutoThumb, the plugin will set the HTML attributes width & height.
Default Link Id: the widget assumes that you set up pages for each gallery and link the gallery to that page (you can use the NGG Gallery Editor to do this). If a gallery has no link set, it will use the default link (id of a page or post).
Exclude galleries: exclude galleries by specifying their ID as comma separated list

All development is done on GitHub. If you have ideas, enhancements, etc. feel free to fork the project and send a pull request.
For any issues please use the Issue Tracker.
Templating:
Beginning with version 0.3, you have full control over the widget’s output as it is controlled with templates. As the built-in templates would get overwritten on every plugin update, create a new directory called “ngg-sidebar-widget” in your theme’s directory and copy the two template files “tpl.outer.html” and “tpl.inner.html” over there to edit them. The outer template is just a wrapper template (useful when you need some additional markup, e.g. when creating a list), the inner template has access to all the values from the gallery and image object (written in a simple templating syntax: {=object.member}). For the most use cases you should only need “gallery.title”, “gallery.link” and “image.url”.
You will have access to the following variables:

gallery

gid
name
path
title
galdesc
pageid
previewpic
author
link

image

errmsg
error
imageURL
thumbURL
imagePath
thumbPath
href
thumbPrefix
thumbFolder
galleryid
pid
filename
description
alttext
imagedate
exclude
thumbcode
name
path
title
pageid
previewpic
permalink
post_id
sortorder
meta_data
gid
galdesc
author
imageHTML
thumbHTML
url
output_width
output_height
output_width_tag
output_height_tag

延伸相關外掛

文章
Filter
Apply Filters
Mastodon