How to control form and event rendering for a custom content type?

stodge - June 26, 2009 - 01:14
Project:Event
Version:6.x-2.x-dev
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I'm prototyping numerous modules that provide custom content types. I've written a basic Event API module as I thought it would be quicker than trying to learn how to use the Event module programmatically. Now I'm second guessing myself and considering replacing my eventapi module with http://drupal.org/project/event and http://drupal.org/project/event.

I played around with these two modules and they provide the same basic functionality as my eventapi module. However, I see that I have no control over the rendering of the event. When my form is rendered the event is displayed before my content is rendered in hook_form function. Also, I render my content type using a custom template file but the event is automatically rendered my template file is rendered.

I may just be missing something important here but how do I either control how and when the event is rendered for my custom content type, or how do I disable it from being rendered so I can render it myself? And similarily, how do I control the rendering of the form? I know about the hooks for altering the forms; is this the best way? I want to display the event form near the bottom of the page and I would also like to control (per content type that has an event) whether the user can enter an end date and/or times.

Thanks for reading this!

#1

stodge - June 26, 2009 - 14:03

I know I could modify hook_nodeapi and empty the event's content in the 'view' case:

$node->content['event']['#value'] = "";

I could then render the event dates in my custom template, but this means rendering the event twice. Any other ideas?

 
 

Drupal is a registered trademark of Dries Buytaert.