- concrete5 Cookbook
- David Strack
- 141字
- 2021-08-13 16:15:58
Getting a page's description
Page descriptions are not used very widely used in concrete5. Some themes will treat them as content excerpts, while other add-ons will use descriptions as a generic attribute storage area. Regardless, they are still built into concrete5, and in this recipe we will load a page by its path and retrieve its description.
Getting ready
Many pages in concrete5 do not have descriptions. If you wish, you can edit a page to add a description as shown in the following screenshot:

How to do it...
The steps for getting a page's description are as follows:
- Open the
/config/site_post.php
file in your code editor. - Load the page by its path.
$page = Page::getByPath('/about');
- Get the page's description.
$description = $page->getCollectionDescription();
- Dump the contents of the description variable.
my_debug($description);
See also
- The Getting a page by its path recipe
推薦閱讀
- Getting Started with React
- 游戲程序設計教程
- 零基礎學Java程序設計
- Android 應用案例開發大全(第3版)
- Mastering RStudio:Develop,Communicate,and Collaborate with R
- Python機器學習基礎教程
- Asynchronous Android Programming(Second Edition)
- Learning Laravel's Eloquent
- 計算機應用基礎實踐教程
- Python Data Structures and Algorithms
- 0 bug:C/C++商用工程之道
- UNIX Linux程序設計教程
- CRYENGINE Game Development Blueprints
- Clojure for Java Developers
- ActionScript 3.0從入門到精通(視頻實戰版)