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

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
主站蜘蛛池模板: 兴化市| 进贤县| 读书| 北海市| 汶川县| 漳平市| 乌海市| 东丰县| 永济市| 阳原县| 于田县| 工布江达县| 花莲市| 阿瓦提县| 堆龙德庆县| 桃江县| 松原市| 宁夏| 汾阳市| 安顺市| 潞城市| 建水县| 财经| 龙泉市| 衡阳县| 中西区| 太湖县| 乌拉特中旗| 保山市| 增城市| 冀州市| 奉新县| 雷山县| 驻马店市| 喜德县| 佛坪县| 塔城市| 长宁区| 陈巴尔虎旗| 武平县| 邢台市|