I'm trying to add a class to the H2 tag that gets created in the group view, but copying node-og-group-post.tpl.php to my theme folder and making the change there doesn't seem to work. If I make the change directly in sites/all/modules/og/theme/node-og-group-post.tpl.php it works fine. Am I doing something wrong or is this a problem?

Comments

moshe weitzman’s picture

Status: Active » Postponed (maintainer needs more info)

You are clearing cache after the copy and rename?

Saoirse1916’s picture

Sorry for the delay -- yes, I've cleared the cache. I got a node-contenttype.tpl.php working so I know my clearing is successful.

jrabeemer’s picture

Do you have node.tpl.php in your theme folder?

Saoirse1916’s picture

No, I don't -- is that necessary?

jrabeemer’s picture

Try it. See if that makes a difference.

ajayg’s picture

Status: Postponed (maintainer needs more info) » Active

I have seen this exact same problem. And yes I have node.tpl.php in my theme directoy. I tried everything from clearing the cache, restarted apache to rebooting the system with no luck.

I found the same workaround. I created multiple template files for each of the type of content OG enabled in the group. So created templates like node-group_contenttype1.tpl.php, node-group_contenttype2.tpl.php etc and individually modified with the required change. But just overriding with a generic template node-og-group-post.tpl.php did not work as reported in the defect.

I stumbled upon this in OG 6.x-1.1 so it has been there for a while. Sorry Should have reported it immediately.

agupta’s picture

I am also trying same thing.
I have a content type say contenttype1 as group post. i want to customize its view so i created node-contenttype1.tpl.php.

but its not working. I have tries same for other content types also(such as blog) and that works fine.

Wondering what is the issue.

ajayg’s picture

look at issue #287298: Overriding node-og-group.tpl.php specially comment #17. Removing "/theme" from that path may resolve this issue. Verify and let us know here.

jzornig’s picture

Putting a copy of node.tpl.php in my theme folder fixed this issue for me.

the55’s picture

adding the node.tpl.php worked for me.

my theme is a sub-theme. i simply copied in the parent theme's node.tpl.php

thanks.

PixelClever’s picture

Version: 6.x-1.3 » 6.x-2.1

I'm seeing a variation of this same bug in the 6x-2.1 release. In my case the node.tpl.php file in my theme folder is getting overridden by node-og-group-post.tpl.php even though the node.tpl.php is in the actual theme folder and the node-og-group-post.tpl.php is only in the module folder. To get around the issue I had to add a copy of node-og-group-post.tpl.php into the theme folder and have it load the node.tpl.php from inside that tpl.

What's really strange about this it doesn't happen universally with all content types.
P.S. I did clear all the caches several times.

krueschi’s picture

I have stumbled upon a variation of this problem.
The override of the first nodetype that is a group post. But if I create a second nodetype that should serve a different kind of data as og group post I'm not able to override the template file. I've tried several naming conventions

  • node-[nodetype].tpl.php
  • node-group-post_[nodetype].tpl.php
  • node-og-group-post_[nodetype].tpl.php

but none of them works.
Caches were cleared many times.
Did I miss something?

[UPDATE]
Yes, I missed something!
In my special theme files there were no "real" node-[nodetype].tpl.php versions. Instead of unsing the plain tpl files I used node-[nodetype]-body.tpl.php for a different theming and THIS doesn't work.
When I restart with clean template files I realize that the override works as follows with og group posts (og 6.x-2.x):

  1. It takes the node-og-group-post.tpl.php out of the og/template folder
  2. If there is a node-og-group-post.tpl.php inside your theme folder it takes this
  3. If there is a more special node-[nodetype].tpl.php for the nodetype that is used as a group post, it takes that file.
  4. An even more specialized node-[nodetype]-body.tpl.php (or equivalent) is not used. (Maybe this could be done with a theme hook or preprocess function; I have to investigate.)

Hope that this helps someone out there.

ajayg’s picture

can we close this , then as "works as designed"?

Grayside’s picture

Status: Active » Closed (works as designed)

Sounds like the bug is resolved. It would be great if someone could document this.