- 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
推薦閱讀
- Microsoft Exchange Server PowerShell Cookbook(Third Edition)
- Raspberry Pi Networking Cookbook(Second Edition)
- aelf區(qū)塊鏈應用架構指南
- PHP 編程從入門到實踐
- Java EE 7 Development with NetBeans 8
- PLC編程及應用實戰(zhàn)
- 零基礎輕松學SQL Server 2016
- BIM概論及Revit精講
- 劍指大數據:企業(yè)級數據倉庫項目實戰(zhàn)(在線教育版)
- Oracle GoldenGate 12c Implementer's Guide
- 移動互聯(lián)網軟件開發(fā)實驗指導
- Web前端應用開發(fā)技術
- Essential C++(中文版)
- OpenCV with Python Blueprints
- 玩轉.NET Micro Framework移植:基于STM32F10x處理器