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 CiviEvent (Moderator: Yashodha Chaku) »
  • question about custom templates for event register form
Pages: [1]

Author Topic: question about custom templates for event register form  (Read 1843 times)

aeszq

  • I post occasionally
  • **
  • Posts: 53
  • Karma: 0
question about custom templates for event register form
March 26, 2009, 07:58:34 pm
Hi guys,
I created a template for event register form, its path is <custom_templates>/CRM/UF/Form/Block.tpl
This tpl is used by the profile attached to the event register form and it works fine.
My question is if I can specify the id of profile this tpl should be implemented , becuase apparently the tpl file will effect all the event register forms.
I tried to use <custom_templates>/CRM/UF/Form/1/Block.tpl. But it seems civicrm doesn't recognize this path.

Also I'm trying to make a custom profile tpl for drupal account creation, default tpl file is /CRM/Profile/Form/Dynamic.tpl.
The same situation, when I use <custom_templates>/CRM/Profile/Form/Dynamic.tpl, it's fine. But <custom_templates>/CRM/Profile/Form/1/Dynamic.tpl doesn't working.

Can any one give a hint?
Thanks

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: question about custom templates for event register form
March 27, 2009, 07:29:09 am

Both the below issues should be considered as bugs. Please file an issue and we'll fix for 2.3

if important to you, please get on IRC and we'll direct you to the right places to modify the code and you can contribute the patch

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

MatthewD

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
Re: question about custom templates for event register form
January 26, 2010, 09:48:06 am
Quote from: aeszq on March 26, 2009, 07:58:34 pm
tried to use <custom_templates>/CRM/UF/Form/1/Block.tpl. But it seems civicrm doesn't recognize this path.


I'm trying to do this with civicrm 3.1 beta5 and it doesn't seem to work.

<custom_templates>/CRM/UF/Form/Block.tpl does work, but that of course overrides for everything.

I'm using <custom_templates>/CRM/UF/Form/Event_ID/Block.tpl rather than a profile id. I have tried both.

Is this fixed. If not, which file should I look in to start fixing it please?

Thanks
   Matthew
« Last Edit: January 26, 2010, 09:57:20 am by MatthewD »

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: question about custom templates for event register form
January 26, 2010, 10:11:04 am

this is not yet fixed, but would be a good patch to contribute back:

a. go a grep in the templates directory:

grep -ir "CRM/UF/Form/Block.tpl" .

b. the above gives u a list of all files that use that tpl. Use the above list to edit all the relevant php files (for the event and contribution u can make the change in the base class. Ideally we should also take this occasion to clean up the code and USE one function that builds the profile for all the above cases. In that case you can just edit that function definition

c. send in the Block.tpl template name to the template as a smarty variable. You first check if a "form id specific" template exists and if so use that, else use the generic one

ping us on irc if u need help getting started with this

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

MatthewD

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
Re: question about custom templates for event register form
January 27, 2010, 06:34:59 am
What's a similar function that already does this that I might use as a good temple please?

Thanks 
   Matthew

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: question about custom templates for event register form
January 27, 2010, 07:51:28 am

check: CRM/Event/Form/Registration.php, function getTemplateFileName

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • question about custom templates for event register form

This forum was archived on 2017-11-26.