Is it possible to use the theme package controller directly from the theme?
Permalink
I want to create a dynamic header.php that references the theme package controller for database access, without using a block.
More specifically, I would like to make a theme package that creates a dedicated database table for my theme, where all theme specific options are referenced. The database would be controlled by a single page in the dashboard, which would use the controller just like a block does. Then the theme itself would reference the controller for access to the database to determine what global options are on or off, and then render accordingly.
Is this as simple as creating a db.xml in the package folder, using the controller to install everything initially, and then referencing the methods in the package controller in the theme and in the single page?
Or do I need to create a controller for the package, a controller for the single page, a controller for every block I add, and a controller for the theme itself? I tried making a controller in the root of a theme, and concrete5 simply added this as a page type.
If I could access the database directly from the theme without using a controller method, that would work, but I am not sure if this would work beautifully, since concrete5 has objects around everything and as well as naming conventions and helpers and such so maybe it's a lot easier to use a built in method I don't know about vs trying to hack it.
If anyone could point me in the right direction I would really appreciate it!
More specifically, I would like to make a theme package that creates a dedicated database table for my theme, where all theme specific options are referenced. The database would be controlled by a single page in the dashboard, which would use the controller just like a block does. Then the theme itself would reference the controller for access to the database to determine what global options are on or off, and then render accordingly.
Is this as simple as creating a db.xml in the package folder, using the controller to install everything initially, and then referencing the methods in the package controller in the theme and in the single page?
Or do I need to create a controller for the package, a controller for the single page, a controller for every block I add, and a controller for the theme itself? I tried making a controller in the root of a theme, and concrete5 simply added this as a page type.
If I could access the database directly from the theme without using a controller method, that would work, but I am not sure if this would work beautifully, since concrete5 has objects around everything and as well as naming conventions and helpers and such so maybe it's a lot easier to use a built in method I don't know about vs trying to hack it.
If anyone could point me in the right direction I would really appreciate it!
inside the theme?
Thanks.