Closed (won't fix)
Project:
CiviEvent Discount
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
10 Mar 2011 at 20:20 UTC
Updated:
5 Sep 2011 at 20:10 UTC
Hi, first of all this module is awesome. Haven't tested it with full registration load, but it looks very sophisticated.
So, we have everything set up for an event registration and when a discount is enabled the field for the discount code shows up all the way at the top of the page. It's kind of an awkward position to have it above the registration form help html. So I was wondering if there is a way to move it down into the "Registration Fee" area?
Thanks
Comments
Comment #1
dharmatech commentedThanks for the feedback Traveler777. Unfortunately, the only way to control field placement on the page is to override the template. CiviCRM makes it relatively easy but you do need to be comfortable editing files. Check the CiviCRM wiki. If you need help, please consider posting your question to the CiviCRM forums.
Comment #2
nubeli commentedThis is what I did to change the location.
1. Set the path for custom templates in CiviCRM (just like in the wiki page linked above)
2. Make a custom version of CRM/Form/body.tpl at custom_civicrm_templates/CRM/Form/body.tpl (or wherever you place the custom templates).
3. Cut everything between the {if $beginHookFormElements} and {/if}.
4. Create a new custom template at CRM/common called hookElements.tpl
5. Insert the $beginHookFormElements text from body.tpl
6. Create custom version of CRM/Contribute/Form/Contribution/Main.tpl (for memberships) and CRM/Event/Form/Registration/Register.tpl (for events).
7. Place this snippet:
{include file="CRM/common/hookElements.tpl"}wherever you want it to appear in the template. I put it after the membership block for contribution pages.8. Turn debugging on (Administer > Configure > Global Settings > Debugging) and then put this at end of URL: &directoryCleanup=1, press enter to refresh page and it should hopefully empty the cache.
It would be nice if CiviCRM didn't put the hook elements in such a straight jacket. This makes it more flexible, but make sure you include the file for every form type you want it to appear in.
CiviCRM has a clunky template system, IMHO, compared to Drupal. I think they added the ability to insert hook elements from Drupal modules much more recently. The place can be improved by what I've done above and I will create an issue on the CiviCRM site.
Comment #3
dharmatech commentedThanks nubeli, added a reference to this on the project page.
Comment #4
Traveler777 commentedThanks nubeli for the detailed description. This will help us getting started on it.
Comment #5
tobedeleted commentedMany thanks for this most helpful step-through. I'd started to look at where and how I might customise the placement of the discount field, and this will save me a lot of time.