- concrete5 Cookbook
- David Strack
- 85字
- 2021-08-13 16:15:58
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:
- Open
/config/site_post.php
in your editor. - Load the page by its path.
$page = Page::getByPath('/about');
- Get the page's title.
$name = $page->getCollectionName();
- Dump the contents of the title variable.
my_debug($name);
See also
- The Getting a page by its path recipe
推薦閱讀
- Implementing VMware Horizon 7(Second Edition)
- C# 7 and .NET Core Cookbook
- Drupal 8 Blueprints
- Python Tools for Visual Studio
- 編譯系統(tǒng)透視:圖解編譯原理
- C++ 從入門到項(xiàng)目實(shí)踐(超值版)
- Hands-On Functional Programming with TypeScript
- CoffeeScript Application Development Cookbook
- 好好學(xué)Java:從零基礎(chǔ)到項(xiàng)目實(shí)戰(zhàn)
- 實(shí)戰(zhàn)Java高并發(fā)程序設(shè)計(jì)(第2版)
- 物聯(lián)網(wǎng)系統(tǒng)架構(gòu)設(shè)計(jì)與邊緣計(jì)算(原書第2版)
- Learning Kotlin by building Android Applications
- 人人都能開(kāi)發(fā)RPA機(jī)器人:UiPath從入門到實(shí)戰(zhàn)
- SQL Server 2012 數(shù)據(jù)庫(kù)應(yīng)用教程(第3版)
- Puppet 5 Beginner's Guide(Third Edition)