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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • can I do this using custom templates or ???
Pages: [1]

Author Topic: can I do this using custom templates or ???  (Read 1309 times)

lucyp

  • Guest
can I do this using custom templates or ???
September 05, 2007, 08:43:10 pm
Hi -

My current challenge is customizing something in CiviContribute. However I believe my question may be more generally relevant, so I am posting here.

What I want is to change which columns are shown in the "recent contributions" list, in the CiviContribute Dashboard screen. For example, my organization does not give premiums, so I'd like to have that column disappear.

I have read the documentation for customizing templates, and in fact have modified the file CRM/Contribute/Form/Selector.tpl, and put my modified version into my custom templates directory. And it sort of works. I was able to remove the premium column from the list of results. BUT I was not able to remove it from the column headings, which are passed into the template as an array $columnHeaders which I don't know how/where to modify.

So my question is, is this something I can change by tweaking templates? Or does it require custom programming? I have looked through the API's and seen some functions that I could use but am not clear on exactly how to proceed. I have found a function deep within the code (public function &getColumnHeaders) that I could modify to just give me the column headers I want, but wouldn't that mean hacking up the actual civicrm code = BAD?

Can anybody point me in the right direction?

I am guessing this type of question will come up again for me for other things that I want to modify in CiviCRM to suit my organization, so I'd really like to improve my understanding of how the whole system works.

(I am even willing to pay somebody to teach me if that's what's needed.)

Thanks very much!

- Lucy

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: can I do this using custom templates or ???
September 05, 2007, 10:40:27 pm

I would just do it in the template and use a conditional

  {foreach from=$columnHeaders item=header}
      {if $header.name != 'Premium'}
         ...
      {/if}
   {/foreach}

i.e. you skip the column header u dont want also.

I suspect this is easier and u avoid modifying the core code etc

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

lucyp

  • Guest
Re: can I do this using custom templates or ???
September 13, 2007, 12:28:15 pm
Thanks lobo, that works great.

And I am learning more about Smarty now, so I can do more with the custom templates.

- lucy

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • can I do this using custom templates or ???

This forum was archived on 2017-11-26.