Inhaltsverzeichnis

At this example we will embed calcms at a Drupal 6 site

Basics

<div id="calcms_WIDGET" >to be replaced</div>

If you want to hide widgets on some page of your website

Drupal Theme

In this example we will customize the standart Garland theme.

page.tpl.php

This page is used for all pages, except „agenda“ pages

At the end of </head> section replace/insert

<!--calcms start-->
        <link rel="alternate" type="application/atom+xml" title="Sendeplan Atom" href="/agenda/atom/" />
        <link rel="alternate" type="application/rss+xml" title="Sendeplan RSS" href="/agenda/rss/" />
	<link rel="alternate" type="application/atom+xml" title="Sendekommentare" href="/agenda/feed_kommentare/" />
        <link rel="stylesheet" type="text/css" media="screen" href="/agenda_files/css/calcms.css" />

        <script type="text/javascript" src="/agenda_files/js/calcms.js"></script>
        <script type="text/javascript" src="/agenda_files/js/calcms.cust.js"></script>
<!--calcms end-->

if your theme does not use jquery by default you will additionally have to include it

        <script type="text/javascript" src="/misc/jquery.js"></script>

below

        <?php print $scripts ?>

template.php (optional)

This enables the page-agenda.tpl template for all nodes of the type „agenda“.

<?php

function calcms_preprocess_page(&$vars){

  //calcms - set template dependent on node type (for "agenda")
  if ($vars['node']->type != "") {
    $vars['template_files'][] = "page-" . $vars['node']->type;
  }
  //calcms end

  $vars['tabs2'] = menu_secondary_local_tasks();

  // Hook into color.module
  if (module_exists('color')) {
    _color_page_alter($vars);
  }
}

?>

page-agenda.tpl.php (optional)

If you want to use a modified layout for the event pages

Enable the theme 'calcms'

Create an agenda node

Define a new content-type „agenda“

name agenda
typ agenda
description don't touch this

Instantiate „agenda“

book create new book
title Event Agenda <span id=„calcms_title“></span>
Übergeordneter Menüpunkt primary links
Content
<div id="calcms_list">please wait...</div>
Input Format Full HTML

Embed Agenda Widgets

Description calcms - search
Title Suche
Content
<div id="calcms_search">
	<form name="calcms_search" onsubmit="selectSearchEventListener();return false;">
		<input id="calcms_search_field" name="search" value="" size="30" max-length="30"><input value="suchen" onclick="selectSearchEventListener();return false;" type="button"></form>
	<div>
		<a href="#" onclick="showAdvancedSearch('calcms_enhanced_search');return false;">erweitert</a>
		<div id="calcms_enhanced_search" style="display: none;">

			Archiv <input type="checkbox" name="calcms_archive" id="calcms_archive"/>
			<span id="calcms_categories"></span>
			<span id="calcms_series_names"></span>
			<span id="calcms_programs"></span>
		</div>
	</div>
</div>
Input Format Full HTML
show block on specific page Show if the following PHP code returns TRUE (PHP-mode, experts only).
<?php
$match = FALSE;
$types = array('agenda' => 1);
if (arg(0) == 'node' && is_numeric(arg(1))) {
  $nid = arg(1);
  $node = node_load(array('nid' => $nid));
  $type = $node->type;
  if (isset($types[$type])) {
    $match = TRUE;
  }
}
return $match;
?>

Add Calendar

Description Kalender
Content
<div id="calcms_calendar">Calendar - please wait</div>
Input Format Full HTML
show block on specific page Show if the following PHP code returns TRUE (PHP-mode, experts only).
<?php
$match = FALSE;
$types = array('agenda' => 1);
if (arg(0) == 'node' && is_numeric(arg(1))) {
  $nid = arg(1);
  $node = node_load(array('nid' => $nid));
  $type = $node->type;
  if (isset($types[$type])) {
    $match = TRUE;
  }
}
return $match;
?>

Add Menu

Description calcms - menu
Content
<div id="calcms_menu">Agenda-Menu - please wait</div>
Input Format Full HTML
show block on specific page Show if the following PHP code returns TRUE (PHP-mode, experts only).
<?php
$match = FALSE;
$types = array('agenda' => 1);
if (arg(0) == 'node' && is_numeric(arg(1))) {
  $nid = arg(1);
  $node = node_load(array('nid' => $nid));
  $type = $node->type;
  if (isset($types[$type])) {
    $match = TRUE;
  }
}
return $match;
?>

Add Playlist

Description calcms - playlist
Title Playlist
Content
<div id="calcms_playlist">what's running now</div>
Input Format Full HTML
show block on specific page Show if the following PHP code returns TRUE (PHP-mode, experts only).

Warning: Following code is different to the previous ones!!!

<?php
$match = TRUE;
$types = array('agenda' => 1);
if (arg(0) == 'node' && is_numeric(arg(1))) {
  $nid = arg(1);
  $node = node_load(array('nid' => $nid));
  $type = $node->type;
  if (isset($types[$type])) {
    $match = FALSE;
  }
}
return $match;
?>

Add newest comments block

Description calcms - new comments
Title neue Kommentare
Content
<div id="calcms_newest_comments">newest comments</div>
Input Format Full HTML

Place blocks at layout

e.g.:

Hints