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

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
主站蜘蛛池模板: 碌曲县| 胶南市| 日土县| 吉安县| 弋阳县| 东山县| 峨眉山市| 江口县| 桓仁| 富宁县| 盐亭县| 大足县| 公主岭市| 朔州市| 襄垣县| 英德市| 杭锦旗| 兴文县| 连南| 常熟市| 红安县| 晋江市| 吴旗县| 托克逊县| 大悟县| 邛崃市| 天柱县| 麻江县| 神池县| 介休市| 长兴县| 嘉鱼县| 大悟县| 武城县| 田林县| 凌云县| 万盛区| 云南省| 平果县| 垦利县| 西乌珠穆沁旗|