Closed (fixed)
Project:
Organic Groups
Version:
6.x-2.1
Component:
og.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jul 2008 at 20:58 UTC
Updated:
10 Nov 2024 at 10:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
marcp commentedAfter you copy node-og-group.tpl.php to your theme's directory you'll need to rename it to reflect your group's node type(s). If your group node type is "club" then you'd rename node-og-group.tpl.php to node-club.tpl.php.
One or two additional lines in README.txt would probably keep this question from showing up so often. Lines 34 thru 38 in README.txt would be the place for the change(s) -- if you come up with some wording, I suspect you can get it in there and save some other folks the hassle of figuring this out for themselves.
Comment #2
moshe weitzman commented@marcp - thats inaccurate. All thats needed is to copy node-og-group.tpl.php to your theme dir and then hack away as desired. It will apply for all group node types. You only need to rename it if you want your changes to apply to a single content type. Of course, anytime you do a theme override like this you must clear the theme cache. see bottom of admin/settings/performance.
the theme developer module (see devel package) is a good way to see what possible theme file names will be accepted and thus understand what your best override strategy is.
Comment #3
marcp commentedThat shows how much I know! Thanks for the correction, Moshe.
Comment #4
marcp commentedI probably should just leave this alone, but a README.txt patch is attached.
Comment #5
elgreg commentedMoshe's solution is the one that I'd like to use (as I have three different types of groups and I'd like them all to have the same layout). I copied node-og-group.tpl.php to my theme directory, but to no avail, it's still going after the one in the module directory. If I remove the one in the module directory, then it picks up the one in my theme directory (I wouldn't actually do this, of course, as it blows the upgrade path). Does this mean that I need to register the file or something? I see the lines in og.module that registers the node-og-group file...
(l320)
and
(l327)
wondering if need to do something similar to get mine to pick up. And, yes. I've cleared the cache like a champ. :)
--UPDATE: I added this code to a custom module and a corresponding template file (node-my-groups-template.tpl.php) it picks that up (after emptying the cache, of course).
I thought that the non-override might be because I'm using a sub-theme, but even when I dropped node-og-group.tpl.php into Garland and emptied the cache it wasn't picked up. ??
Comment #6
moshe weitzman commentedI found a bug in the way that I injected theme_paths. This made it very hard to override og provided templates fro mwithin the theme. We should be good now. Please reopen if needed.
Comment #7
elgreg commentedCool! I took a look myself and changed the line in og.module from
to:
to push the path on the top beginning of the end of the array and it looks like this took care of allowing node-og-group.tpl.php file to override in my theme.
Is this about the same as what you did in your patch?
Thanks for the quick attention!
Comment #8
moshe weitzman commentedclose. see http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/og/og.modul.... the og path has to come just before the modules/node
Comment #9
elgreg commentedTouché! :)
Comment #10
mshaver commentedThis works fine now. If you wanted to use the default node.tpl.php file instead of the node-og-group-post.tpl.php, how would you do so?
Comment #11
moshe weitzman commentedthe easiest if to move/delete the og one. if you want to leve it, you have to unalter what og does in its theme_register_alter hook.
Comment #12
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #13
noelbush commentedI am using 6.x-2.0-rc3 and I have this same problem. I have copied node-og-group-post.tpl.php into my theme's directory and made my desired modifications. I have rebuilt the theme registry. Yet my template file is still not picked up, according to the Theme Developer UI. It shows the original og version still being used. Is this a regression, or is there something else I should check?
Comment #14
mshaver commentedI threw this bit of code into my template file within the preprocess_node function so that I could use the standard node.tpl.php file instead of the node-og-group-post.tpl.php. Not sure if that helps you though?
Comment #15
moshe weitzman commentedWorks for me. Your theme (or subtheme) has to implement node.tpl.php as well. Thats a limitation of core drupal..
Comment #16
iamwhoiam commentedFantastic, thanks. The latest dev fixed it.
Comment #17
ajayg commented@moshe
just want to bring to your attention about comment #8
in the 6.x.1-3 version that line is
Vs the latest in Dev is
Notice the "/theme" missing in the end in latest dev. IS that what you intended since there is a theme directory inside og module. Or that directory is more of documentation purpose and the theme inside those directoy, if kept as it is, has no effect till copied to your sites theme directoy?
Comment #18
moshe weitzman commentedthat looks like a bug in 6.x.1 series but is fixed in 6.2 which is releasing very soon.
Comment #20
francis55 commentedHi all,
I am trying to change the layout of the group's main page.
I have overridden all the following files in my theme:
then cleared the cache
I've seen the change on an ordinary page, but the pages within the group - particularly, the group page - remain unchanged.
I am using Drupal Commons: Drupal 6.22, Drupal Commons 1.7
The cascade of themes, as far as I can gather, is:
my theme > Commons origins > Commons roots > fusion_core
Comment #21
francis55 commentedComment #22
Grayside commentedDon't know what could be causing that, the code has been working fine for years now. I imagine commons is on 6.x-2.1 now.
However, I suspect this relates to how you are building out the theme. I suggest you pursue theme-oriented support channels, and if expected behavior is not working, return here.
Comment #23
Grayside commentedComment #25
claudiu.cristea