- concrete5 Cookbook
- David Strack
- 103字
- 2021-08-13 16:15:58
Getting a page's page type ID
As we discussed earlier in the chapter, pages are assigned a page type. In this recipe, we will get the page type ID from a Page
object.
How to do it...
The steps for getting a page's page type ID are as follows:
- Open
/config/site_post.php
in your code editor, so we can run some arbitrary code. - Load the page by its path.
$page = Page::getByPath('/about');
- Get the page type ID for this page.
$pageTypeId = $page->getCollectionTypeID();
- Dump the page type ID using our custom debugging function.
my_debug($pageTypeId);
See also
- The Getting a page by its path recipe
推薦閱讀
- jQuery EasyUI網(wǎng)站開發(fā)實(shí)戰(zhàn)
- PHP+MySQL網(wǎng)站開發(fā)技術(shù)項(xiàng)目式教程(第2版)
- 數(shù)據(jù)結(jié)構(gòu)簡明教程(第2版)微課版
- Building Mobile Applications Using Kendo UI Mobile and ASP.NET Web API
- Python完全自學(xué)教程
- Learning Vaadin 7(Second Edition)
- Arduino家居安全系統(tǒng)構(gòu)建實(shí)戰(zhàn)
- Linux C編程:一站式學(xué)習(xí)
- Internet of Things with ESP8266
- Python Essentials
- Android Game Programming by Example
- Node.js區(qū)塊鏈開發(fā)
- Mastering OAuth 2.0
- SQL Server實(shí)例教程(2008版)
- Android開發(fā)進(jìn)階實(shí)戰(zhàn):拓展與提升