官术网_书友最值得收藏!

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:

  1. Open the /config/site_post.php file in your code editor.
  2. Load the page by its path.
    $page = Page::getByPath('/about');
  3. Get the page's description.
    $description = $page->getCollectionDescription();
  4. Dump the contents of the description variable.
    my_debug($description);

See also

  • The Getting a page by its path recipe
主站蜘蛛池模板: 城固县| 石阡县| 辛集市| 辛集市| 瑞昌市| 河西区| 铜鼓县| 永宁县| 清涧县| 财经| 中牟县| 井陉县| 中方县| 沙河市| 白山市| 冷水江市| 象山县| 东方市| 中超| 恭城| 张家口市| 汤原县| 长汀县| 通辽市| 克山县| 尚志市| 克什克腾旗| 荆门市| 临安市| 乌兰察布市| 二连浩特市| 油尖旺区| 曲水县| 祁门县| 高尔夫| 南宁市| 仪陇县| 菏泽市| 宝清县| 忻城县| 怀安县|