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

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
主站蜘蛛池模板: 满城县| 平谷区| 武平县| 沅江市| 会同县| 九江市| 浑源县| 勐海县| 修水县| 桃园市| 南江县| 巨野县| 淳安县| 靖远县| 昭平县| 庄河市| 焦作市| 无极县| 江永县| 饶平县| 康平县| 镇赉县| 罗定市| 永平县| 顺平县| 普陀区| 梨树县| 昆山市| 泸定县| 灵武市| 洛南县| 英山县| 金川县| 灵川县| 松溪县| 乐安县| 湖南省| 包头市| 香港 | 乌恰县| 钦州市|