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

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
主站蜘蛛池模板: 马鞍山市| 调兵山市| 五常市| 自贡市| 莎车县| 南充市| 井研县| 凤阳县| 临洮县| 河源市| 巴彦县| 邵东县| 迁安市| 曲水县| 龙江县| 连南| 昭苏县| 荆门市| 长子县| 城口县| 姜堰市| 仁化县| 姚安县| 阳泉市| 江源县| 神农架林区| 读书| 陵水| 孟连| 梨树县| 山西省| 应用必备| 洪泽县| 杭锦后旗| 木兰县| 平泉县| 余姚市| 伊春市| 张掖市| 霍城县| 岳阳市|