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

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
主站蜘蛛池模板: 郁南县| 类乌齐县| 闵行区| 调兵山市| 慈溪市| 郁南县| 平果县| 浦北县| 黄石市| 竹溪县| 缙云县| 北宁市| 呼伦贝尔市| 忻州市| 辉南县| 鲜城| 吕梁市| 东安县| 沈丘县| 鹤岗市| 钦州市| 墨竹工卡县| 高安市| 南郑县| 岱山县| 宜君县| 广灵县| 义马市| 叶城县| 长乐市| 麟游县| 延庆县| 逊克县| 昭平县| 晴隆县| 韩城市| 商南县| 汽车| 嘉义县| 榆林市| 修文县|