- concrete5 Cookbook
- David Strack
- 102字
- 2021-08-13 16:15:58
Getting a page's handle
Pages, like page types and other objects in concrete5, have handles in addition to paths. The handle is similar to a slug in other content management systems. In this exercise, we will load a page by its ID and then retrieve its handle.
How to do it...
The steps for getting a page's handle are as follows:
- Open
/config/site_post.php
in your code editor. - Load the page by its ID.
$page = Page::getByID(4);
- Get the page's handle.
$handle = $page->getCollectionHandle();
- Dump the handle variable to see its contents.
my_debug($handle);
See also
- The Getting a page by its ID recipe
推薦閱讀
- Python科學(xué)計算(第2版)
- 復(fù)雜軟件設(shè)計之道:領(lǐng)域驅(qū)動設(shè)計全面解析與實戰(zhàn)
- AngularJS Web Application Development Blueprints
- 精通搜索分析
- Bootstrap 4:Responsive Web Design
- Jenkins Continuous Integration Cookbook(Second Edition)
- Kotlin從基礎(chǔ)到實戰(zhàn)
- PySide 6/PyQt 6快速開發(fā)與實戰(zhàn)
- Java系統(tǒng)化項目開發(fā)教程
- MySQL從入門到精通(軟件開發(fā)視頻大講堂)
- Go語言精進(jìn)之路:從新手到高手的編程思想、方法和技巧(2)
- Android開發(fā)三劍客:UML、模式與測試
- SQL Server 2008 R2數(shù)據(jù)庫技術(shù)及應(yīng)用(第3版)
- Hands-On Kubernetes on Windows
- Java Web應(yīng)用開發(fā)項目教程