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

  • 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:

  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
主站蜘蛛池模板: 烟台市| 东源县| 密山市| 滦平县| 荔浦县| 平罗县| 深州市| 化德县| 玉山县| 郯城县| 万州区| 皮山县| 广水市| 平乐县| 泸溪县| 修水县| 东乡县| 福州市| 北票市| 镇沅| 双辽市| 抚顺市| 青神县| 丹棱县| 博客| 乐业县| 荣昌县| 瑞昌市| 松江区| 景谷| 仁化县| 苍南县| 门源| 永泰县| 大厂| 长寿区| 治多县| 沧源| 沾化县| 山东省| 青岛市|