Jump to:
| Project: | Nitobe |
| Version: | 6.x-2.5 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Shannon Lucas |
| Status: | postponed (maintainer needs more info) |
Issue Summary
Hi!
Right now, there's no support for Organic Groups (OG) in Nitobe - posts from organic groups are rendered using the OG default styles, which don't look that great with (and certainly different from) your beautiful theme...
I've found out that it's sufficient to provide two template files named
node-og-group.tpl.php
node-og-group-post.tpl.phpin the nitobe directory, e.g. as simple copies of (or symlinks to) the Nitobe node.tpl.php file. This ensures that the OG template files of the same name (located in .../modules/og/theme) are overwritten by the theme engine, making the look of OG posts the same as for generic (non-group) posts.
There's another template file in OG (og-mission.tpl.php) which renders the mission for a given OG group (if any); for a generic solution, the nitobe CSS would probably need some styling for the og-mission class which is used for the div which holds the mission itself. As far as I understand the OG code, the path to the og-mission.tpl.php file is hardcoded in og.module, so it cannot be overwritten by simply providing an alternative option in the them folder - but of course the CSS could be replaced (I haven't done that so far, but you might want to do that in order to have a consistent design).
I could provide a patch containing the two files mentioned above - but then, they are really just copies of an existing file...
Hope this is useful,
Christian.
Comments
#1
#2
#3
Looking into this right now.
#4
I am not positive what benefit this would give the theme. OG already makes use of those two tpl files, and anyone who wants to customize them would override them themselves, however I don't see the need. Wouldn't it make better sense to optimize the CSS somewhat to suit the OG sections?
#5
I don't know what the best way to support OG is, really. What I just stumbled over is that without modifications, OG posts look rather different from the standard posts - the default templates and CSS used by OG don't fit that nicely into Nitobe's design.
A simple solution that worked for me is just to overwrite the default templates used by OG in the theme by simply copying (or symlinking) Nitobe's standard node.tpl.php to the OG template names. So far, I haven't experienced any problems with this, and I also believe that no OG functionality is broken or lost.
As you point out, another approach would be to provide all the right CSS styling for the native OG templates. The drawback of that approach IMHO would be that (a) even users that don't run OG load the OG-related CSS every time and (b) you need to track changes in the OG styling in the theme, which seems like a nightmare to me.
That said, I also agree on the benefits argument - I don't think a generic Drupal theme really needs to explicitly support non-core modules, even if they are important or widely used. I mean, if the symlinking/copying trick is working, and the theme maintainers are happy with the results, I would think that just mentioning this approach in the documentation and/or README file would give users with OG a reasonably good start.
Does that make sense?
#6
Let me know if OG can do something differently to help Nitobe.
#7
I need to look into this. Earlier versions of Nitobe were doing some unnatural things with various pieces of content. This may no longer be an issue in the 6.4 branch.
#8
Please test this again against the most current version of the theme to see if the problem persists.