- 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:
- Open
/config/site_post.php
in your preferred code editor. - Load the page by its path.
$page = Page::getByPath('/about');
- Get the theme object.
$theme = $page->getCollectionThemeObject();
- Dump the theme object to inspect the class.
my_debug($theme);
See also
- The Getting a page by its path recipe
推薦閱讀
- 新編Visual Basic程序設計上機實驗教程
- UI圖標創意設計
- PyTorch自動駕駛視覺感知算法實戰
- Boost C++ Application Development Cookbook(Second Edition)
- JavaScript+jQuery開發實戰
- HTML5+CSS3網站設計基礎教程
- Ext JS 4 Web Application Development Cookbook
- HTML5從入門到精通 (第2版)
- PLC應用技術(三菱FX2N系列)
- Julia 1.0 Programming Complete Reference Guide
- Learning WordPress REST API
- 自己動手構建編程語言:如何設計編譯器、解釋器和DSL
- React.js實戰
- 數據庫技術及應用教程上機指導與習題(第2版)
- jQuery基礎教程(第4版)