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) »
  • Getting customPre CMSUser.tpl and email all in one fieldset
Pages: [1]

Author Topic: Getting customPre CMSUser.tpl and email all in one fieldset  (Read 1477 times)

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Getting customPre CMSUser.tpl and email all in one fieldset
September 13, 2009, 02:30:06 pm
Hi - can anyone run through the steps required (assuming this is possible which I don't) so that on a Contribution form we can have the customPre, <fieldset> = email and the CMSUser.tpl to all appear as if in the same 'fieldset' box

It obviously isn't as simple as putting a <fieldset> around all 3 and removing any <fieldset> from within the two included tpls

If i need to modify the Block.tpl can i just name to eg Blockxx.tpl and rename the files specified in our customised contribute/Form/Contribution/1/Main.tpl assuming we only want the changes showing on this Contribution Page.

So my objective would be something that would achieve the below

<fieldset>
{include file="CRM/common/CMSUser.tpl"}

<legend>e-mail</legend>
      {assign var=n value=email-$bltID}
      <table class="form-layout-compressed"><tr><td class="label">YOUR EMAIL HERE:</td>
      <td>&nbsp;{$form.$n.html}
      </td>

   </tr>
   </table>

{include file="CRM/UF/Form/Blockxx.tpl" fields=$customPre}
</fieldset>
« Last Edit: September 13, 2009, 03:47:54 pm by peterd »
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Getting customPre CMSUser.tpl and email all in one fieldset
September 13, 2009, 06:29:49 pm
why wouldn't you be able to wrap all three in a fieldset and make sure they're not in the included files? that would be my first suggestion.

i believe a fieldset may only have one legend, and it should be the first tag after the fieldset tag. so i'm not sure you're sample would work.

FWIW -- I run into the issue where the email chunk looks odd because it's separate from the rest and not contained in a fieldset, so the styling looks weird. I usually just wrap it in it's own fieldset with legend to retain consistency.

you know, another option to look at --
I believe that the form on those pages unsets the primary email address if it's included in the profile (so you don't have duplicate primary email address fields). it would make more sense to hide the hardcoded email address block IF the primary email address is included in the profile. may not be a big deal to switch that around. that at least gives you the flexibility to control the location of the email within the profile.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Getting customPre CMSUser.tpl and email all in one fieldset
September 13, 2009, 06:39:38 pm
Thanks Brian - I agree this  area is a bit clunky as three components that regularly get included 'drupal user' 'email' and a profile - all have their own chunks and formatting isn't consistent by default as I see it. Will see if others respond on the 'how to wrap the fieldset' since I am not too sure about just leaving out the include files in case there are other repercussions to that.

Yes I like your idea of setting the default so that 'if email address is in profile then don't show the 'email block' - happy to try since that sounds like a suggestion I would want on all my sites - but again will wait for other comments before considering it.
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Getting customPre CMSUser.tpl and email all in one fieldset
September 13, 2009, 06:42:52 pm
Pete,
i wasn't suggesting leaving out the included files --
just modifying them so that they didn't have the fieldset tags. that's how i read your initial post.
i guess the concern would be that they might be included elsewhere, and the lack of fieldsets would throw off formatting. but i'm pretty sure Civi does a decent job keeping the contrib page templates separate from others.
-B
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Getting customPre CMSUser.tpl and email all in one fieldset
September 13, 2009, 08:21:25 pm
Brian - thanks for the encouragement - yes that worked

I hadn't intended implying that I wanted a label in the middle, that was just a bit of code i copied in to try and flesh out what I was playing with.

I need to look around and see if other bits are now awry but .... so far so good. And I may as well have a wee go at writing this up in case it is of any help to others once i figure out the last bits I need.
« Last Edit: September 13, 2009, 08:32:17 pm by peterd »
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Getting customPre CMSUser.tpl and email all in one fieldset
September 14, 2009, 01:23:55 am
Knowing that the more thorough write up could be a way off ;-) here is the summary

In order to get the Username, Email and Profile all in the same fieldset required the following

1/ reorder the includes in the Main.tpl

2/ comment out the fieldsets in the CRM/common/CMSUser.tpl

3/ comment out the fieldsets in a customised CRM/UF/Form/BlockXX.tpl

4/ recode the include file in Main.tpl to look for the above customised BlockXX.tpl (so the deleted fieldset doesn't affect other places that Block.tpl is used)
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Getting customPre CMSUser.tpl and email all in one fieldset

This forum was archived on 2017-11-26.