The changes to get the Civicspace working in Drupal 4.7 are relatively minor:

  1. Fix paths in template.php
  2. Change references in page.tpl.php from path_to_theme() to civicspace_path_to_theme()
  3. Add favicon handling to page.tpl.php

I'm not sure why this hasn't been done and propogated to 4.7 yet. But here it is, I hope this helps someone.

See also: Changes in base href in 4.7

Code diffs for template.php and page.tpl.php after the break...

diff template.php

27c27
<   return '/' . dirname($themes[$theme_key]->filename);
---
>   return dirname($themes[$theme_key]->filename);
30,33d29
< function civicspace_path_to_theme() {
<   return '/' . path_to_theme();
< }
<

diff page.tpl.php

25,34d24
<   static $settings;
<   if (empty($settings) || $refresh) {
<     $settings = theme_get_settings($theme_key);
<   }
< 
<   $favicon = $settings['favicon_path'];
<   if ($favicon != '' && !$settings['default_favicon']){
<     print '<link rel="shortcut icon" href="/' . $favicon . '" type="image/x-icon" />';
<   }
< 
37c27
<     print phptemplate_stylesheet_import(civicspace_path_to_theme() .'/global/print/print.css','print, screen');
---
>     print phptemplate_stylesheet_import(path_to_theme() .'/global/print/print.css','print, screen');
40c30
<     print '<link href="'. civicspace_path_to_theme() .'/global/styles/utility.css" rel="stylesheet" media="all" />'. "\n";    
---
>     print '<link href="'. path_to_theme() .'/global/styles/utility.css" rel="stylesheet" media="all" />'. "\n";    
56c46
<         print phptemplate_stylesheet_import(civicspace_path_to_theme() .'/admin/admin.css','screen');    
---
>         print phptemplate_stylesheet_import(path_to_theme() .'/admin/admin.css','screen');    
71c61
<       behavior: url("<?php print civicspace_path_to_theme() ?>/scripts/csshover.htc");
---
>       behavior: url("<?php print path_to_theme() ?>/scripts/csshover.htc");
86,87c76,77
<   <script language="JavaScript" src="<?php print civicspace_path_to_theme() ?>/scripts/pngfix.js" type="text/javascript"></script>
<   <script language="JavaScript" src="<?php print civicspace_path_to_theme() ?>/scripts/utility.js" type="text/javascript"></script>
---
>   <script language="JavaScript" src="<?php print path_to_theme() ?>/scripts/pngfix.js" type="text/javascript"></script>
>   <script language="JavaScript" src="<?php print path_to_theme() ?>/scripts/utility.js" type="text/javascript"></script>
91c81
<     document.write('<' + 'script language="JavaScript1.2" type="text/javascript" src="<?php print civicspace_path_to_theme() ?>/scripts/toggle.js"><\/script>');
---
>     document.write('<' + 'script language="JavaScript1.2" type="text/javascript" src="<?php print path_to_theme() ?>/scripts/toggle.js"><\/script>');
222c212
<                   <img src="<?php print civicspace_path_to_theme() ?>/images/bg_mission.png" class="alignright no-print" alt="Flag decoration" />
---
>                   <img src="<?php print path_to_theme() ?>/images/bg_mission.png" class="alignright no-print" alt="Flag decoration" />
234c224
<                       <a href="javascript:void(0);" onclick="toggleShow('help');toggleShow('toggle-help-hide');toggleHide('toggle-help-show');" class="toggle-link"><img src="<?php print civicspace_path_to_theme(); ?>/global/images/icon_collapsed.png" alt="Collapse" /> Show help</a>
---
>                       <a href="javascript:void(0);" onclick="toggleShow('help');toggleShow('toggle-help-hide');toggleHide('toggle-help-show');" class="toggle-link"><img src="<?php print path_to_theme(); ?>/global/images/icon_collapsed.png" alt="Collapse" /> Show help</a>
237c227
<                       <a href="javascript:void(0);" onclick="toggleHide('help');toggleHide('toggle-help-hide');toggleShow('toggle-help-show');" class="toggle-link"><img src="<?php print civicspace_path_to_theme(); ?>/global/images/icon_expanded.png" alt="Expand" /> Hide help</a>
---
>                       <a href="javascript:void(0);" onclick="toggleHide('help');toggleHide('toggle-help-hide');toggleShow('toggle-help-show');" class="toggle-link"><img src="<?php print path_to_theme(); ?>/global/images/icon_expanded.png" alt="Expand" /> Hide help</a>
240c230
<                       <img src="<?php print civicspace_path_to_theme() ?>/global/images/icon_help.png" alt="Help icon" class="icon-help" />
---
>                       <img src="<?php print path_to_theme() ?>/global/images/icon_help.png" alt="Help icon" class="icon-help" />

Comments

douggreen’s picture

4. Fix expanding menus by not overriding the onload event

248,251c238
<                         addLoadEvent(civicspace_load_help);
<                       function civicspace_load_help() {
<                           toggleHide('help');toggleShow('toggle-help-show');
<                       }
---
>                         window.onload = toggleHide('help');toggleShow('toggle-help-show');
douggreen’s picture

More template.php fixes, change pager_link to theme_pager_link

calebgilbert’s picture

I made all of the changes above and everything but the images seems to be coming in correctly. The layout looks great and seems function. Just no images. Anyone?

Arto’s picture

To get the images to show, add the following to the head element in page.tpl.php:

<base href="/" />

There still appear to be several other problems after this, mostly CSS-related.

Arto’s picture

To get the images to show, add the following to the head element in page.tpl.php:

<base href="/" />

There still appear to be several other problems after this, mostly CSS-related.

jasonwhat’s picture

I'm having some trouble trying to apply these patches. Can someone post a patched version of template.php and page.tpl.php?

douggreen’s picture

In response to Arto's comments, it is not the best solution to do a . Drupal 4.7 removed the from the core intentionally. See http://drupal.org/node/58446

dalin’s picture

Why don't we just use $directory instead of all this path_to_theme() rigamarole?

douggreen’s picture

Version: master » 4.7.x-1.x-dev
Status: Active » Closed (won't fix)

This theme appears to be no longer supported or under development. See http://drupal.org/project/civicspace_theme.