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

dharmatech’s picture

Status: Active » Closed (won't fix)

Thanks 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.

nubeli’s picture

This 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.

dharmatech’s picture

Thanks nubeli, added a reference to this on the project page.

Traveler777’s picture

Thanks nubeli for the detailed description. This will help us getting started on it.

tobedeleted’s picture

Many 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.