[WordPress] 外掛分享: Collapsing Pages

前言介紹

  • 這款 WordPress 外掛「Collapsing Pages」是 2008-04-28 上架。
  • 目前有 300 個安裝啟用數。
  • 上一次更新是 2024-01-01,距離現在已有 489 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 5.0 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

robfelty |

外掛標籤

menu | pages | widget | sidebar | navigation |

內容簡介

這是一個非常簡單的外掛程式,使用 Javascript 在側邊欄中形成一個可收合的頁面連結組。對於每一個對應於特定父頁面的頁面都會被展開。

這個外掛程式的基礎主要是來自我的 Collapsing Pages 和 Collapsing Archives 外掛程式。

新增功能

1.0.1 (2016.05.09)

修復有時設置手風琴為 false 會破壞 JavaScript 的 bug

1.0 (2015.08.12)

兼容 WordPress 4.3
修正擴展符號出現在指定的最低深度的 bug (感謝 tkibler 指出)
新增僅顯示當前子頁面的選項
新增顯示頂層頁面的選項 (之前一直在顯示)
新增手風琴風格選項
精簡小部件設置
改進樣式管理,包括能夠指定每個小部件的樣式
從 unicode 符號切換為 HTML 實體
如果為空,則不顯示標題的標籤
修正頁面標題屬性的 bug
完全重寫 JavaScript

選項

如果使用手動版本,您可以像其他 WordPress 函數 (如 wp_list_pages) 一樣,通過數組或使用查詢風格傳遞選項。

$defaults = array(
'title' => __('Pages', 'collapsing-pages'),
'sortOrder'=> 'ASC' ,
'sort'=> 'pageName' ,
'defaultExpand'=> '',
'expand' => 0,
'depth' =>-1,
'inExcludePage' => 'exclude',
'linkToPage' => true,
'inExcludePages' => '',
'showPosts' => false,
'animate' => 0,
'useCookies' => true,
'postTitleLength' => 0,
'showTopLevel' => true,
'currentPageOnly' => false,
'debug' => false,
);

inExcludePage

是否包含或排除某些頁面

exclude (默認)
include

inExcludePages

應被包含或排除的頁面

showPosts

是否包括文章以及頁面。如果為 false 則為默認值

linkToPage

True,點擊父級頁面標題將鏈接到該頁面 (默認)
False,點擊父級頁面將展開以顯示子頁面

sort

如何排序頁面。可能的值:

pageName 頁面的標題(默認)
pageId 頁面的 ID
pageSlug 頁面的 URL
menuOrder 在頁面設置中指定的自定義順序

sortOrder

頁面是否應該按正常或反向順序排序,可能的值:

ASC 正常順序 (a-z 0-9) (默認)
DESC 反向順序 (z-a 9-0)

expand

用於標記擴展和收縮的符號,可能的值:

0 三角形符號 (默認)
1 + 和 - 號
2 [+]和[-]符號
3 圖像 (如有必要,您可以上傳自己的圖像)

原文外掛簡介

This is a very simple plugin that uses Javascript to form a collapsable set of
links in the sidebar for the pages. Every page corresponding to a given
parent page will be expanded.
It is largely based off of my Collapsing Pages and Collapsing Pages
plugins.
What’s new?

2.0.3 (2024.01.01)

Fixed issue with subsubpages not closing correctly
Got rid of some more warnings
Tested with 6.4.2

2.0.2 (2023.12.01)

Got rid of some warnings
Updated deprecated property __experimentalGroup
Tested with 6.4.1

2.0.1 (2023.06.16)

Bug fixes

2.0.0 (2023.03.17)

Updated to use Gutenberg block

1.0.1 (2016.05.09)

Fixed bug where sometimes setting accordion to false broke javascript

1.0 (2015.08.12)

Compatible with WordPress 4.3
Fixed bug where expanding symbol showed up at lowest depth specified instead
(thanks to tkibler for pointing it out)
Added option to only display pages of the current subpage
Added option to show top-level page (previously it was always shown)
Added accordion style option
Cleaned up widget settings
improved style management, including the ability to specify style per widget
Switched from unicode symbols to html entities
Not showing tags for title if empty
Fixed bug with title attribute of pages
Totally rewrote javascript

Options
If using the manual version, you can pass options either as an array, or using
the query style, just like for other wordpress functions such as
wp_list_pages
$defaults=array(
'title' => __('Pages', 'collapsing-pages'),
'sortOrder'=> 'ASC' ,
'sort'=> 'pageName' ,
'defaultExpand'=> '',
'expand' => 0,
'depth' =>-1,
'inExcludePage' => 'exclude',
'linkToPage' => true,
'inExcludePages' => '',
'showPosts' => false,
'animate' => 0,
'useCookies' => true,
'postTitleLength' => 0,
'showTopLevel' => true,
'currentPageOnly' => false,
'debug' => false,
);

inExcludePage

Whether to include or exclude certain pages

‘exclude’ (default)
‘include’

inExcludePages

The pages which should be included or excluded

showPosts

Whether or not to include posts as well as pages. Default if false

linkToPage

True, clicking on a parent page title will link to that page (default)
False, clicking on a parent page will expand to show sub-pages

sort

How to sort the pages. Possible values:

‘pageName’ the title of the page (default)
‘pageId’ the Id of the page
‘pageSlug’ the url of the page
‘menuOrder’ custom order specified in the pages settings

sortOrder

Whether pages should be sorted in normal or reverse
order. Possible values:

‘ASC’ normal order (a-z 0-9) (default)
‘DESC’ reverse order (z-a 9-0)

expand

The symbols to be used to mark expanding and collapsing. Possible values:

‘0’ Triangles (default)
‘1’ + –
‘2’ [+] [-]
‘3’ images (you can upload your own if you wish)
‘4’ custom symbols

customExpand

If you have selected ‘4’ for the expand option, this character will be
used to mark expandable link categories

customCollapse

If you have selected ‘4’ for the expand option, this character will be
used to mark collapsible link categories

postTitleLength

Truncate post titles to this number of characters (default: 0 = don’t
truncate)

animate

When set to true, collapsing and expanding will be animated

useCookies

When true, expanding and collapsing of pages is remembered for each
visitor. When false, pages are always display collapsed (unless
explicitly set to auto-expand). Possible values:

true (default)
false

showTopLevel

True – show top level pages (default)
False – only display sub-pages and below

currentPageOnly

True – show only parent and sub pages of the current page
False – show all pages (subject to the include or exclude parameters
set) (default)

debug

When set to true, extra debugging information will be displayed in the
underlying code of your page (but not visible from the browser). Use
this option if you are having problems

Examples
collapsPage('animate=true&sort=ASC&expand=3,inExcludePages=about')

This will produce a list with:
* animation on
* shown in alphabetical order
* using images to mark collapsing and expanding
* exclude page about
Demo
I use this plugin in my blog at http://blog.robfelty.com
CAVEAT
Currently this plugin relies on Javascript to expand and collapse the links.
If a user’s browser doesn’t support javascript they won’t see the links to the
posts, but the links to the pages will still work (which is the default
behavior in wordpress anyways)

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Collapsing Pages」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


0.6 | 1.0 | 0.1.1 | 0.2.5 | 0.3.5 | 0.4.3 | 0.5.1 | 0.5.2 | 0.5.3 | 0.6.1 | 1.0.1 | 2.0.2 | 2.0.3 | trunk | 0.5.beta | 0.5.alpha |

延伸相關外掛(你可能也想知道)

  • Widgets for Google Reviews 》onal version of our review software, you can:, , , Display unlimited Google Reviews, Customize widget design and behavior, Respond to reviews direc...。
  • Blocksy Companion 》Blocksy Companion 是一個外掛,將 Blocksy 主題轉化為強大的瑞士軍刀工具。, 只有在安裝並啟用 Blocksy 主題時,它才會運行並添加增強功能。, 最小需求, , W...。
  • Black Studio TinyMCE Widget 》此外掛添加了一個新的 Visual Editor 小工具類型,讓您能夠在側邊欄中輕鬆地插入豐富的文字和媒體對象。使用 Black Studio TinyMCE Widget 時,您將能夠使用W...。
  • Widget Importer & Exporter 》Widget Importer & Exporter 是一個有用的外掛,可將小工具從一個WordPress站點移動到另一個站點,備份小工具,並供主題開發人員為用戶提供範例小工具。...。
  • Orbit Fox by ThemeIsle 》透過Orbit Fox,您可以使用各種模組擴充您的主題功能,例如社交媒體分享按鈕和圖示、自訂選單圖示、頁首和頁尾腳本、一鍵導入頁面模板、頁面建構器附加元件和...。
  • Recent Posts Widget With Thumbnails 》列出最新的文章標題、縮略圖、摘要、作者、類別、日期等等!, 雖然此外掛僅建立在小工具區域,但使用者報告說它在 Elementor 和 Oxygen 上運作順暢。但它是否...。
  • WordPress Popular Posts 》WordPress Popular Posts 是一個高度可定製的小工具,可以顯示您最受歡迎的文章。, 主要特點, , 多小工具功能 – 您可以在您的博客上擁有多個 WordPress...。
  • Widget Logic 》此外掛可在每個小工具中新增一個名為 "Widget logic" 的額外控制欄,讓您控制這個小工具會出現在哪些頁面上。文字欄位允許您使用 WP 的Conditional Tags或任...。
  • Social Media Share Buttons & Social Sharing Icons 》在你的免費測試網站上試試看:點擊此處 => https://tastewp.com/plugins/ultimate-social-media-icons, (這個技巧適用於所有外掛 – 只需在外掛的 WP 存儲庫 ...。
  • Fixed Widget and Sticky Elements for WordPress 》使用 Fixed Widget 外掛可以創建黏貼式的小部件、區塊和其他元素,當用戶向上或向下滾動頁面時,它們會保持在可見的屏幕區域內。, 相較於非固定小工具,黏貼...。
  • PHP Code Widget 》普通的文字小工具允許您插入任意文字和/或 HTML 代碼。這個外掛程式也允許這樣做,但還會解析文本小工具中的任何 PHP 代碼並執行它。, 這可以讓您更輕鬆地遷...。
  • Image Widget 》Image Widget 是一個簡單的外掛程式,利用 WordPress 原生媒體管理員,為您的網站新增圖片小工具。, 需要新增幻燈片、燈箱或隨機圖像嗎?, 請查看 Image Widg...。
  • Custom Sidebars – Dynamic Sidebar Classic Widget Area Manager 》使用 Custom Sidebars,一個靈活的小工具管理器,在您的網站上管理和替換側邊欄和其他小工具區。, 製作自訂側邊欄配置,能夠選擇在您網站的每個頁面或文章上...。
  • Recent Posts Widget Extended 》外掛描述, 此外掛可以啟用自定義、靈活且進階的最新文章功能,您可以透過簡碼或小工具來顯示它。您可以顯示具有縮略圖、摘要和發佈日期的最新文章清單,並且...。
  • Widget Shortcode 》這個短碼需要小工具的ID,但不需要猜測,外掛會為你生成代碼。如果你想要覆蓋小工具的標題,你可以使用 "title" 參數:, [widget id=”text-1″...。

文章
Filter
Apply Filters
Mastodon