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

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
主站蜘蛛池模板: 沙田区| 哈巴河县| 宣威市| 晋宁县| 鄱阳县| 皮山县| 临沭县| 武川县| 武夷山市| 革吉县| 勃利县| 自贡市| 两当县| 洛宁县| 桑植县| 安宁市| 凤冈县| 祁连县| 巴林右旗| 项城市| 仙居县| 龙岩市| 于都县| 呼玛县| 贵南县| 上蔡县| 扎兰屯市| 和田市| 云梦县| 阳谷县| 张家港市| 木兰县| 客服| 聂拉木县| 邵阳市| 永定县| 璧山县| 宝丰县| 肥乡县| 固始县| 舟山市|