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

  • concrete5 Cookbook
  • David Strack
  • 119字
  • 2021-08-13 16:15:59

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
主站蜘蛛池模板: 棋牌| 宜春市| 江安县| 新巴尔虎右旗| 重庆市| 湟源县| 霍山县| 江口县| 方山县| 平武县| 汶上县| 塘沽区| 来凤县| 万荣县| 嘉兴市| 雷波县| 南涧| 南乐县| 康乐县| 廊坊市| 界首市| 韶山市| 城固县| 黔南| 肥东县| 曲水县| 迁西县| 黔西| 德庆县| 赤水市| 滦南县| 江孜县| 泸定县| 株洲县| 拜泉县| 黄骅市| 中超| 泾川县| 南华县| 德阳市| 合山市|