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

Getting a page's name

Page names are often used as the de facto titles in concrete5. In this exercise, we will load a page by its path, and then get its name.

How to do it...

The steps for getting a page's name are as follows:

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

See also

  • The Getting a page by its path recipe
主站蜘蛛池模板: 唐海县| 师宗县| 广汉市| 金堂县| 沙雅县| 彭泽县| 亚东县| 武威市| 禄丰县| 鹤庆县| 彭州市| 南投市| 台南市| 奈曼旗| 公主岭市| 永嘉县| 樟树市| 宁远县| 海阳市| 洪雅县| 隆回县| 枝江市| 连江县| 宜州市| 辽阳县| 陇南市| 博爱县| 唐海县| 化州市| 固原市| 焦作市| 锦屏县| 庆元县| 祥云县| 澎湖县| 巴南区| 蓝山县| 黑龙江省| 西乌珠穆沁旗| 灵璧县| 正宁县|