Hi,

I'd like to use Events without the calendar. I would like to remove the Calendar link that shows up in each event node.

I have tried editing the Content Type Settings, setting "show in event calendar" to none. But when I do that, events no longer have ANY start/finish date or time fields. Is there a way to keep the start / end fields while removing the calendar link?

Thanks in advance for your help. It is greatly appreciated!
Mdlepage

Comments

mdlepage’s picture

Component: Miscellaneous » Code

Hi there, still looking for help on this please. Any suggestions at to how to remove the Calendar link in an event node?

Thanks,
M

frank ralf’s picture

That's the generated HTML for the link:

<li class="event_calendar first last">
   <a href="/drupal6/event/2008/10/09">Calendar</a>
</li>

So you just create a CSS style with:

.event_calendar{
   display: none !important;
}

Voilá!

As a general rule, most modules add their own CSS classes or ids in the generated HTML. So for presentation purposes you usually can rely on just modifying some CSS style sheet instead of tinkering with module code itself.

Frank

jbomb’s picture

you can also use hook_link_alter()

function your_module_link_alter(&$node, &$links) {
	if ($node->type == 'event') {
		unset($links['event_calendar']);
	}
}
martysteer’s picture

I believe the arguments are reversed for D6.x. It should be:
function your_module_link_alter(&$links, &$node)...

See: http://api.drupal.org/api/function/hook_link_alter

The link ID I have to unset is also different: $links['calendar_link']

jbomb’s picture

@martysteer that's correct. The arguments are reversed in drupal 6. The provided snippet should be relevant for drupal 5.

martysteer’s picture

Oh yeah. Thanks for clarifying.

onelittleant’s picture

In Drupal 6, this implementation of hook_link_alter will remove the "Calendar" link from all event-enabled content types:

function your_module_link_alter(&$links, &$node) 
{
    unset($links['event_calendar']);
}
japerry’s picture

Status: Active » Closed (outdated)

Event for Drupal 8 is unrelated to older versions. If an issue similar to this one exists, please open a new issue with the 8.x branch.