CiviNode Theming And UI

Theming in CiviNode right now is pretty simple, and I could use some advice. I've discovered that different modules do this pretty different one from the other, even in 4.7. Generally I'm doing something between what flexinode does and what Event does. This may or may not sound like a good thing to you :-)

The key theming routine right now is theme_crm_profile_group($pid, $node); I take a CRM profile ID and the node object itself, and generate very generic, semantic HTML. The default presentation is a bordered box with the title over the border, and the fields are rendered as definition lists. This degrades reasonably, and looks reasonably good with the default civinode.css file.

This is an area I could use some help and advice, and I'm very open to suggestions how to do this better. Currently, I'm not using .tpl files, and I'm not using a .theme file. If someone can tell me why this is better than what I'm doing, I'm very open on this subject.

CRM Profile Groups are a good way to go since CRM uses them internally to track how to draw its UI, and you can get metadata about fields from various CRM calls. Profiles also serve as a way to limit access to a contact: there are calls that will only show you the fields of a particular profile, and if the profile does not define that field, you can't see it. I use this in the access control scheme as well.

I've communicated some with Mark Fredrickson, who's also doing a great deal of CRM coding right now, who suggests integrating CRM with CCK. The profile-based theming would work very well for CCK, since you could define CCK slots that corresponded to one-contact/one-profile. If you needed more detail, add another slot for the same contact, but a different profile. This would be pretty easy to implement, and would probably look very nice as well.