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

Getting a page's theme object

Every page can have its own individual theme in concrete5. While it's typical for most sites to only use one global theme, concrete5 does allow developers to set individual themes for each page. In this recipe, we will get the page's theme object, which can be used to see what theme is active on a given page.

How to do it...

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

  1. Open /config/site_post.php in your preferred code editor.
  2. Load the page by its path.
    $page = Page::getByPath('/about');
  3. Get the theme object.
    $theme = $page->getCollectionThemeObject();
  4. Dump the theme object to inspect the class.
    my_debug($theme);

See also

  • The Getting a page by its path recipe
主站蜘蛛池模板: 手游| 神农架林区| 榆社县| 彰武县| 秀山| 夏邑县| 德令哈市| 通州市| 长丰县| 织金县| 深泽县| 曲松县| 和林格尔县| 仪陇县| 工布江达县| 时尚| 南和县| 阿拉尔市| 淮滨县| 辉县市| 襄樊市| 澎湖县| 天气| 溧阳市| 临泉县| 吴川市| 临夏市| 浦东新区| 昌平区| 景宁| 皋兰县| 陕西省| 嘉兴市| 绥阳县| 深州市| 桂林市| 大庆市| 习水县| 北辰区| 萍乡市| 肥城市|