- 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
推薦閱讀
- ExtGWT Rich Internet Application Cookbook
- JavaScript+DHTML語法與范例詳解詞典
- 三維圖形化C++趣味編程
- Expert Android Programming
- 差分進化算法及其高維多目標優化應用
- Modern JavaScript Applications
- SQL Server從入門到精通(第3版)
- Oracle GoldenGate 12c Implementer's Guide
- PHP編程基礎與實踐教程
- Troubleshooting Citrix XenApp?
- Fastdata Processing with Spark
- Android應用開發攻略
- 程序員的英語
- TypeScript High Performance
- Microsoft Hyper-V PowerShell Automation