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

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
主站蜘蛛池模板: 吴川市| 临江市| 宾阳县| 崇阳县| 金堂县| 平邑县| 苍南县| 南宫市| 临高县| 都安| 宣化县| 册亨县| 古田县| 靖远县| 潜江市| 临湘市| 息烽县| 海原县| 蛟河市| 克山县| 炉霍县| 车致| 祁门县| 中宁县| 乌鲁木齐县| 博湖县| 乌兰县| 肃南| 马边| 炎陵县| 永安市| 凤阳县| 永清县| 贺兰县| 贵州省| 宣城市| 内黄县| 河津市| 乾安县| 兴隆县| 颍上县|