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

Getting a page's handle

Pages, like page types and other objects in concrete5, have handles in addition to paths. The handle is similar to a slug in other content management systems. In this exercise, we will load a page by its ID and then retrieve its handle.

How to do it...

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

  1. Open /config/site_post.php in your code editor.
  2. Load the page by its ID.
    $page = Page::getByID(4);
  3. Get the page's handle.
    $handle = $page->getCollectionHandle();
  4. Dump the handle variable to see its contents.
    my_debug($handle);

See also

  • The Getting a page by its ID recipe
主站蜘蛛池模板: 诸城市| 武隆县| 山东| 兖州市| 鄂尔多斯市| 古丈县| 辽宁省| 台中县| 山东省| 织金县| 平陆县| 开平市| 容城县| 临清市| 乌兰浩特市| 竹溪县| 斗六市| 社会| 七台河市| 通海县| 太保市| 民和| 临澧县| 砚山县| 富宁县| 石屏县| 荆州市| 溆浦县| 淮南市| 汤阴县| 苏尼特右旗| 云阳县| 休宁县| 萝北县| 鄂托克旗| 治多县| 榕江县| 济南市| 辛集市| 西吉县| 莒南县|