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) »
  • Hacking templates for specific custom activity types
Pages: [1]

Author Topic: Hacking templates for specific custom activity types  (Read 530 times)

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Hacking templates for specific custom activity types
August 08, 2014, 08:30:28 am
Having set up some activity types to suit my needs I find I don't want to display the default "Details" field in one specific activity type (id =826). Having read http://book.civicrm.org/developer/current/techniques/templates/ I thought I could apply the same logic that is set out there about targeting specific types using their ID in the path, e.g. [custom-templates]/CRM/Case/Form/826/Activity.tpl and editing that file to suit.

But it doesn't seem to be the case. Any ideas on how to edit specific activity types?
Graham Mitchell
http://mc3.coop

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: Hacking templates for specific custom activity types
August 10, 2014, 08:06:20 am
I'd be surprised if 826 is the id. Check what appears in the id column on the admin page where you create the types.

But even if that is the right id, that method doesn't work for all entities - I'm not sure if it's available for activities/case activities.

You could also try CRM/Case/Form/Activity.extra.tpl (see the section in your book link above title "Appending jQuery or other code to a template"), and do something like
{if $activityTypeName eq 'whatever'}
  cj('tr.crm-case-activity-form-block-details').hide();
{/if}

$activityTypeName might not be the right variable. Use {debug} to see what variables are available.

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: Hacking templates for specific custom activity types
August 10, 2014, 01:19:40 pm
Thanks for the tips.

Indeed the activity type id was incorrect - I think I must have mistaken it for a contact id. Looking at using the extra.tpl approach as an alternative.
Graham Mitchell
http://mc3.coop

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCase (Moderator: Dave Greenberg) »
  • Hacking templates for specific custom activity types

This forum was archived on 2017-11-26.