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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Using .extra.tpl file for Additional Event Participants for a specific event?
Pages: [1]

Author Topic: Using .extra.tpl file for Additional Event Participants for a specific event?  (Read 529 times)

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Using .extra.tpl file for Additional Event Participants for a specific event?
November 15, 2013, 02:45:29 pm
[Is this better posted in "Using CiviEvent"?]

Hi all,

I'm trying to customize a template for a specific event with an event_id of "2". I can place Register.extra.tpl into <customdir>/templates/CRM/Event/Form/Registration/2 and it works great.  However, I can't put AdditionalParticipant.extra.tpl into that directory, which I assume is related to the fact that the event_id isn't part of the URL when loading that template.

Have other folks encountered this?  Is there a workaround?  I'm assuming the event ID is somewhere in the session variables if I had to dig it out - is that how other folks do this?
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Using .extra.tpl file for Additional Event Participants for a specific event?
November 17, 2013, 10:13:07 am
Quote from: JonGold on November 15, 2013, 02:45:29 pm
Have other folks encountered this?  Is there a workaround?  I'm assuming the event ID is somewhere in the session variables if I had to dig it out - is that how other folks do this?

I have used such a method for customizations, yes.
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.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Using .extra.tpl file for Additional Event Participants for a specific event?
November 18, 2013, 07:27:05 pm
There is also a hook you can use - not sure if it's on the wiki (karma if you add it)


  /**
   * This hooks allows alteration of the tpl file used to generate content. It differs from the
   * altercontent hook as the content has already been rendered through the tpl at that point
   *
   * @param $formName  previously generated content
   * @param $form reference to the form object
   * @param $context  context of content - page or form
   * @param $tplName reference the file name of the tpl
   *
   * @access public
   */
  static function alterTemplateFile($formName, &$form, $context, &$tplName) {
    return self::singleton()->invoke(4, $formName, $form, $context, $tplName,
      self::$_nullObject,
      'civicrm_alterTemplateFile'
    );
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Using .extra.tpl file for Additional Event Participants for a specific event?

This forum was archived on 2017-11-26.