Integrating problog with themes
Permalink Browser Info Environment
Hi there,
I'm developing a theme (for internal use) and was wondering what the best practice is for the theme to override the various block styles.
I've tried adding the view and template files in the blocks section of my package but C5 seems to be giving the problog ones first priority.
Thanks & cheers
I'm developing a theme (for internal use) and was wondering what the best practice is for the theme to override the various block styles.
I've tried adding the view and template files in the blocks section of my package but C5 seems to be giving the problog ones first priority.
Thanks & cheers
Type: | Discussion |
---|---|
Status: | New |
Hi Chad, thanks for getting back to me.
I'm packaging my theme so I'd put them in `/packages/mypackage/blocks/problog_list`. This didn't work so I moved them to `/blocks/problog_list` it works fine.
I have other packages that add templates ok but it's seems overriding the default view or an existing templates of another package doesn't work. It looks like concrete isn't giving precedence to the blocks in the active theme - which is a bit of a pain.
Do you know if this works for others?
Thanks & cheers
I'm packaging my theme so I'd put them in `/packages/mypackage/blocks/problog_list`. This didn't work so I moved them to `/blocks/problog_list` it works fine.
I have other packages that add templates ok but it's seems overriding the default view or an existing templates of another package doesn't work. It looks like concrete isn't giving precedence to the blocks in the active theme - which is a bit of a pain.
Do you know if this works for others?
Thanks & cheers
Ok, have had a dig around in C5 and may have found the problem/solution.
Currently Concrete5_Library_BlockViewTemplate->computeView() (at about line 77) scans all installed packages to find a particular template but does so in installation order. Because it iterates over all without breaking the last one wins. I tried replacing the somewhat confusing continue statement (line 177) with a break and that in deed broke things (c:
I then just updated the package list to ensure the package of the current theme (if it has one) is always checked last. This seems have to have fixed the issue and if I create `/packages/mypackage/blocks/content/blog_post/view.php` it is being picked up in preference to problogs template and everything else seems happy.
I'll fill an issue/pull request and see if this is a candidate for a fix.
Thanks & cheers
Currently Concrete5_Library_BlockViewTemplate->computeView() (at about line 77) scans all installed packages to find a particular template but does so in installation order. Because it iterates over all without breaking the last one wins. I tried replacing the somewhat confusing continue statement (line 177) with a break and that in deed broke things (c:
I then just updated the package list to ensure the package of the current theme (if it has one) is always checked last. This seems have to have fixed the issue and if I create `/packages/mypackage/blocks/content/blog_post/view.php` it is being picked up in preference to problogs template and everything else seems happy.
I'll fill an issue/pull request and see if this is a candidate for a fix.
Thanks & cheers
I've looked further into this and think it might be possible to allow themes to override the default templates for blocks provided by other packages.
I've created a post discussing the idea athttp://www.concrete5.org/community/forums/customizing_c5/proposal-t...
Any thoughts greatly appreciated.
Cheers
I've created a post discussing the idea athttp://www.concrete5.org/community/forums/customizing_c5/proposal-t...
Any thoughts greatly appreciated.
Cheers
ChadStrat