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

Type: Discussion
Status: New
andrewpietsch
View Replies:
RadiantWeb replied on at Permalink Reply
RadiantWeb
depends if you are packaging your theme or not. If so, you would place your custom block views in the package (not package/theme/) /blocks folder. Otherwise they would go in your root /blocks folder.

ChadStrat
andrewpietsch replied on at Permalink Reply
andrewpietsch
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
andrewpietsch replied on at Permalink Reply
andrewpietsch
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
andrewpietsch replied on at Permalink Reply
andrewpietsch
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

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.