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

  • 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:

  1. Open /config/site_post.php in your code editor, so we can run some arbitrary code.
  2. Load the page by its path.
    $page = Page::getByPath('/about');
  3. Get the page type ID for this page.
    $pageTypeId = $page->getCollectionTypeID();
  4. Dump the page type ID using our custom debugging function.
    my_debug($pageTypeId);

See also

  • The Getting a page by its path recipe
主站蜘蛛池模板: 牟定县| 西华县| 古丈县| 崇仁县| 五莲县| 珲春市| 襄城县| 安顺市| 长沙县| 青冈县| 麻栗坡县| 文昌市| 古蔺县| 汤阴县| 长治市| 册亨县| 姚安县| 高唐县| 罗源县| 通州区| 理塘县| 南通市| 合阳县| 四会市| 德格县| 正宁县| 连州市| 阳泉市| 平顺县| 和静县| 福建省| 金门县| 德江县| 石门县| 徐闻县| 左贡县| 阿拉善左旗| 克拉玛依市| 通河县| 东辽县| 诸暨市|