CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • CiviCRM theme
Pages: [1]

Author Topic: CiviCRM theme  (Read 11972 times)

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
CiviCRM theme
August 27, 2007, 05:39:14 pm
How do you go about using a different theme for CiviCRM than you do your Drupal site?

I installed the CiviCRM Theme module, but that only themes the CiviCRM admin pages. The places I really need the custom theme are on the search pages since they don't work well on our theme.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviCRM theme
August 27, 2007, 06:34:31 pm

You might want to file an issue against civicrm_theme module on drupal.org and see if doug can extend civicrm_theme to do the needful

I just checked the civicrm_theme module and it seems like it themes all the civicrm pages. Note that CiviCRM does not    have any "drupal admin" pages, all admin is done in the civicrm module itself.

Disclaimer: I have not played with the civicrm_theme module

lobo
 
« Last Edit: August 27, 2007, 06:38:28 pm by Donald Lobo »
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviCRM theme
August 27, 2007, 07:24:27 pm

I actually installed civicrm_theme to see how it works. Its a nifty little module (thanx doug!) and it does allow the "drupal admin" to have different themes for civicrm user pages vs civicrm admin pages. So it does cover your case

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

bob schmitt

  • I’m new here
  • *
  • Posts: 22
  • Karma: 1
    • Expeditionary Information Systems
Re: CiviCRM theme
September 21, 2007, 05:13:23 pm
You can also manually switch your templates based on data in the URL string (e.g. /civicrm* ) if you are using phptemplate as your Drupal theme engine.

The way you do it is explained in one of the phptemplate code snippets on the Drupal.org site, but here's a short explanation:

1) Go to your theme template directory.
2) Copy your page.tpl.php template and name it page-default.tpl.php
3) Open page.tpl.php and replace the code that's there with this code:

<code>
<?php
/*insert replacement page templates for taxonomy lists, vocabulary
lists, and admin pages */

if (arg(0)=="civicrm") {
include 'page-civicrm.tpl.php';
return; }

else {include 'page-default.tpl.php';
return; }

?>

</code>

arg(0) is the first argument after your base URL in drupal (e.g. http://your.site/civicrm/)
arg(1) is the second argument after your base url, and so on.

This basically tells drupal to go to a  page template called page-civicrm.tpl.php when it finds civicrm in the first argument of a url on your site.

You can then create a new page template (duplicate your page-default template) called page-civicrm.tpl.php, which can then call out other style sheets to change how the civicrm tables are displayed on your site.

-----------------------

Another easy fix for this problem is to simply remove blocks from the left and right-hand side of your pages on any page with civicrm in the URL. You can do this by setting each of your blocks to not appear on pages that have civicrm* in them (do this in the little box at the bottom of the block configuration edit screen).

shrill

  • Guest
Re: CiviCRM theme
April 29, 2008, 06:04:32 am
Hi. I have the same problem but would like to use the theme that I have created for the Civicrm pages. I am using Drupal 5.2 but am relatively new to PHP.

I have tried the "block removal" idea here and it works to a point but still doesn't free up enough space for the civicrm table. I normally have 2 sidebars but I can't remove both as I need to keep my admin menu accessible.

How wide is the civicrm table by default?

Thanks!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: CiviCRM theme
April 29, 2008, 05:34:31 pm
We don't specify a fixed width for the search results table - so it expands to take the room available / needed based on the data in it and the surrounding "theme". If you have some HTML / css expertise you might try adding styling to the table to make it suit your needs. Ideally, do this using a "custom copy" - so you don't have to worry about upgrades overwriting your modifications.

The file used for displaying search results is:
emplates/CRM/Contact/Form/Selector.tpl
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • CiviCRM theme

This forum was archived on 2017-11-26.