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

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
主站蜘蛛池模板: 揭阳市| 贵港市| 盐源县| 葫芦岛市| 彰化县| 甘洛县| 会泽县| 涟水县| 明溪县| 房山区| 剑阁县| 仙居县| 五寨县| 延川县| 吴忠市| 枣阳市| 资中县| 绥芬河市| 磐安县| 黑水县| 曲阳县| 长宁县| 满洲里市| 谷城县| 渝中区| 报价| 潢川县| 安徽省| 阳东县| 罗江县| 将乐县| 兴安县| 新干县| 通城县| 浮山县| 连山| 巴林左旗| 新巴尔虎左旗| 铜梁县| 北京市| 龙门县|