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

Getting a page's page type handle

In addition to being able to retrieve the ID of a page's page type, developers can also get the handle.

How to do it...

The steps for getting a page's page type handle are as follows:

  1. Open /config/site_post.php in your code editor, since we will just be running some arbitrary code.
  2. Load the page by its path.
    $page = Page::getByPath('/about');
  3. Get the page type handle.
    $handle = $page->getCollectionTypeHandle();
  4. Dump the handle variable to see its contents.
    my_debug($handle);

See also

  • The Getting a page by its path recipe
主站蜘蛛池模板: 襄樊市| 烟台市| 都江堰市| 彭水| 邵阳市| 贡觉县| 亚东县| 天水市| 沛县| 彭山县| 象州县| 酒泉市| 沙坪坝区| 南华县| 普宁市| 集贤县| 山阳县| 竹溪县| 安溪县| 赞皇县| 铜川市| 高青县| 福州市| 阿拉尔市| 措勤县| 南汇区| 兴仁县| 扎鲁特旗| 贡嘎县| 滁州市| 新和县| 兰西县| 南阳市| 呈贡县| 嘉荫县| 辉县市| 双流县| 东平县| 长宁县| 天峻县| 临海市|