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

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
主站蜘蛛池模板: 玛曲县| 历史| 旬阳县| 广饶县| 谷城县| 佛冈县| 洛川县| 横山县| 庄浪县| 文化| 古交市| 嘉义市| 旅游| 兴义市| 惠州市| 苍溪县| 霍邱县| 金昌市| 红安县| 泰州市| 紫阳县| 霸州市| 兴海县| 昭平县| 乌拉特后旗| 佛学| 祁门县| 梧州市| 武宁县| 晋宁县| 玉屏| 宣恩县| 寿阳县| 鹤山市| 哈巴河县| 汤阴县| 深水埗区| 芦山县| 莎车县| 元江| 兴仁县|