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 »
  • Using CiviCase (Moderator: Dave Greenberg) »
  • Customised template by casetype?
Pages: [1]

Author Topic: Customised template by casetype?  (Read 809 times)

nickholden

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 1
  • CiviCRM version: 4.4.1
  • CMS version: Drupal 7
  • MySQL version: 5.5.32
  • PHP version: 5.4
Customised template by casetype?
November 20, 2013, 09:13:48 am
I'm sure I read somewhere that it was possible to implement custom templates specific to individual case types, in the same way that you can implement custom templates in relation to different subtypes of contact. But I now can't find any reference to it. Did I dream it? Or can someone provide the right directory structure for the templates to be implemented for only one specific case type?

Thanks

Nick

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Customised template by casetype?
November 20, 2013, 12:04:00 pm
As far as I can remember, I don't think it is possible to have separate custom templates for each case types in CiviCase.

Kurund
Found this reply helpful? Support CiviCRM

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Customised template by casetype?
November 20, 2013, 11:16:12 pm
You can however set custom groups for case types, are you refering to templates as the Smarty .tpl file? Or are you not a developer and hoping to add some data on a specific custom type?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Customised template by casetype?
November 21, 2013, 04:29:50 am
You could make one template and check in it for the case type and then use that to customize. You could even then include a unique template, arranged by case type. Then the "real" templates are unique files.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

nickholden

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 1
  • CiviCRM version: 4.4.1
  • CMS version: Drupal 7
  • MySQL version: 5.5.32
  • PHP version: 5.4
Re: Customised template by casetype?
November 21, 2013, 05:44:35 am
Thanks, guys. Hershel's suggestion sounds interesting, and might be the solution.

Erik, yes, I'm talking about .tpl files, specifically the one at /CRM/Case/Audit/Report.tpl

We basically have one case type where the printed report needs to include references to family members, whereas for other case types it doesn't. It's more complex than that, because there's also some custom data to include, but you get the idea.

Hershel, if we followed your approach, would it imply having a custom /CRM/Case/Audit/ that was essentially nothing more than a switch statement with a series of includes for sub-templates? And can the sub-templates live in the same directory or do we need to put them somewhere lese?

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Customised template by casetype?
November 21, 2013, 06:00:33 am
Nick,
I'd recommend you store the custom templates in your own custom template folder, as you would the customized Audit/Report.tpl. And yes, it would simply be a switch to include a specific template for a case type (right Hershel?)
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Customised template by casetype?
November 21, 2013, 06:06:57 am
Nick, yes and yes.

Erik, yes, right.

I'm just a yes-man I guess. :)
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

nickholden

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 1
  • CiviCRM version: 4.4.1
  • CMS version: Drupal 7
  • MySQL version: 5.5.32
  • PHP version: 5.4
Re: Customised template by casetype?
November 21, 2013, 08:32:19 am
Thanks, both! We will see what we can do.

nickholden

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 1
  • CiviCRM version: 4.4.1
  • CMS version: Drupal 7
  • MySQL version: 5.5.32
  • PHP version: 5.4
Re: Customised template by casetype?
December 06, 2013, 09:16:57 am
Thanks for your suggestions, we do now have custom audit reports being printed for two different case types. Easy when you know how...

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCase (Moderator: Dave Greenberg) »
  • Customised template by casetype?

This forum was archived on 2017-11-26.