create a com_contact named Contact , category Forms
create a custom field (radio : Sex->M/F) for com_contact form, category Forms
in Contact settings:
tab Display -> Show User Custom Fields -> All (category Forms is not in the list)
tab Fields -> sex displayed as label only Sex
custom field Sex should be displayed in frontend contact form
not displayed
php 5.6
on localhost AMPPS
question for @laoneo #11833 (comment)
Labels |
Added:
?
|
You need to set them for the context Mail, otherwise they will appear on contacts.
I cannot switch from contact to mail , and if I select mail I cannot create a custom field
no idea how to do it
and no idea how to set a contact custom field to mail, there is no option for it
In the list where the fields are displayed (as shown in my screenshot of the first comment) select mail. Then hit the new button and create your field.
added another field -> Job (text)
it's displayed but disabled and disabled = no in the settings
<div class="controls"><input type="text" name="jform[params][mail-field-job]" id="jform_params_mail_field_job" value="" disabled="">
</div>
Title |
|
Title |
|
Title |
|
This fields do belong to the front end form. You will see the fields on the contact form on the front end.
no they are not on the frontend form
the text field is disabled and the radio buttons are not displayed
the code displayed on front end
<form id="contact-form" action="/j37/index.php/contact-form" method="post" class="form-validate form-horizontal well">
<fieldset>
<legend>Send an Email</legend>
<div class="control-group">
<div class="control-label">
<span class="spacer"><span class="before"></span><span class="text"><label id="jform_spacer-lbl" class=""><strong class="red">*</strong> Required field</label></span><span class="after"></span></span> </div>
<div class="controls"> </div>
</div>
<div class="control-group">
<div class="control-label">
<label id="jform_contact_name-lbl" for="jform_contact_name" class="hasPopover required" title="" data-content="Your name." data-original-title="Name">
Name<span class="star"> *</span></label>
</div>
<div class="controls"><input type="text" name="jform[contact_name]" id="jform_contact_name" value="" class="required" size="30" required="required" aria-required="true">
</div>
</div>
<div class="control-group">
<div class="control-label">
<label id="jform_contact_email-lbl" for="jform_contact_email" class="hasPopover required" title="" data-content="Email Address for contact." data-original-title="Email">
Email<span class="star"> *</span></label>
</div>
<div class="controls"><input type="email" name="jform[contact_email]" class="validate-email required" id="jform_contact_email" value="" size="30" autocomplete="email" required="required" aria-required="true"></div>
</div>
<div class="control-group">
<div class="control-label">
<label id="jform_contact_emailmsg-lbl" for="jform_contact_emailmsg" class="hasPopover required" title="" data-content="Enter the subject of your message here." data-original-title="Subject">
Subject<span class="star"> *</span></label>
</div>
<div class="controls"><input type="text" name="jform[contact_subject]" id="jform_contact_emailmsg" value="" class="required" size="60" required="required" aria-required="true">
</div>
</div>
<div class="control-group">
<div class="control-label">
<label id="jform_contact_message-lbl" for="jform_contact_message" class="hasPopover required" title="" data-content="Enter your message here." data-original-title="Message">
Message<span class="star"> *</span></label>
</div>
<div class="controls"><textarea name="jform[contact_message]" id="jform_contact_message" cols="50" rows="10" class="required" required="required" aria-required="true"></textarea></div>
</div>
<div class="control-group">
<div class="control-label">
<label id="jform_contact_email_copy-lbl" for="jform_contact_email_copy" class="hasPopover" title="" data-content="Sends a copy of the message to the address you have supplied." data-original-title="Send a copy to yourself">
Send a copy to yourself</label>
<span class="optional">(optional)</span>
</div>
<div class="controls"><input type="checkbox" name="jform[contact_email_copy]" id="jform_contact_email_copy" value="1"></div>
</div>
</fieldset>
<fieldset>
<legend>Fields</legend>
<div class="control-group">
<div class="control-label">
<label id="jform_params_field_mail_sex-lbl" for="jform_params_field_mail_sex" class="">
Sex</label>
<span class="optional">(optional)</span>
</div>
<div class="controls"><fieldset id="jform_params_field_mail_sex" class="radio" disabled="">
</fieldset>
</div>
</div>
<div class="control-group">
<div class="control-label">
<label id="jform_params_mail_field_job-lbl" for="jform_params_mail_field_job" class="">
Job</label>
<span class="optional">(optional)</span>
</div>
<div class="controls"><input type="text" name="jform[params][mail-field-job]" id="jform_params_mail_field_job" value="" disabled="">
</div>
</div>
</fieldset>
<div class="control-group">
<div class="controls">
<button class="btn btn-primary validate" type="submit">Send Email</button>
<input type="hidden" name="option" value="com_contact">
<input type="hidden" name="task" value="contact.submit">
<input type="hidden" name="return" value="">
<input type="hidden" name="id" value="1:contact-form">
<input type="hidden" name="2c0b5a8a134b8e672ef31fe0ecdf3e5b" value="1"> </div>
</div>
</form>
You need to set the edit value permission for the public group to allowed.
in User Groups > Edit > allowed , nothing changes
in the field itself > Permissions > all to Allowed , but nothing change
and allow editing to public for all is not what one want, one want only permissions for contact custom fields
ok now it works for textarea but not for radio buttons, they are not displayed
<div class="controls"><fieldset id="jform_params_field_mail_sex" class="radio"></fieldset></div>
@infograf768 I have set the permissions but button radio are not displayed
I meant that permissions are flawed imho in com_fields. They are unsufficient at best.
@infograf768 please discus the sense of the new permission in #12693 and not here. The problem is that the checkbox is not shown properly.
Category | ⇒ | com_fields |
Yes, also on the back end. I try to fix it...
Not sure if I did it right
libraries/joomla/form/parameters/radio.xml
the xml value now :
<field
name="name"
label="JLIB_FORM_FIELD_PARAM_RADIO_MULTIPLE_VALUES_KEY_LABEL"
size="30"
type="text"
/>
doesn't work , no radio button in frontend
and I have another problem in backend, the tab fields doesnt exist anymore
You need to save the values again when you edit the radio field.
I saved the values again
but what I get is wrong
the displayed code
<fieldset id="jform_params_field_mail_sex" class="radio">
<input type="radio" id="jform_params_field_mail_sex0"
name="jform[params][field-mail-sex]"
value="M">
<label for="jform_params_field_mail_sex0">1</label>
<input type="radio" id="jform_params_field_mail_sex1"
name="jform[params][field-mail-sex]"
value="F">
<label for="jform_params_field_mail_sex1">F</label>
</fieldset>
it should be
<input type="radio" id="jform_params_field_mail_sex1"
name="jform[params][field-mail-sex]"
value="1">
<label for="jform_params_field_mail_sex1">M</label>
<input type="radio" id="jform_params_field_mail_sex0"
name="jform[params][field-mail-sex]"
value="0">
<label for="jform_params_field_mail_sex0">F</label>
in the admin panel there is no fields tab anymore
this fields tab exists in com_content
Send a copy to yourself should be just before the button send email and not between the core and custom fields but maybe it can be fixed with view overrides
thanks for your work
if I submit the contact form I get that email
This is an enquiry email via http://192.168.178.20/j37/ from:
My Name<my@email>
contenu de mon message
<br />
<b>Notice</b>: Undefined property: stdClass::$render_class in <b>/www/j37/components/com_contact/layouts/field/render.php</b> on line <b>19</b><br />
Sex: F
<br />
<b>Notice</b>: Undefined property: stdClass::$render_class in <b>/www/j37/components/com_contact/layouts/field/render.php</b> on line <b>19</b><br />
Job: photographe
job: photographe is the custom field type= text (it works)
Can you please test it with the most actual code from staging as most of the issues you experience should be solved now. Thanks.
I never know what to download and install exactly, is there a very las version of joomla with your code ?
thank you
You can download the latest builds from here https://developer.joomla.org/nightly-builds.html.
new install J37 last version
same radio buttons Field, I get the email
This is an enquiry email via http://192.168.178.20/j37/ from:
NAME <myname@gmail.com>
MESSAGE
<dl class="fields-container article-info muted"></dl>
with dl class="fields-container article-info muted"... instead of the radio value
and as I said before the fields tab is not displayed any more in the contact form edit, it's missing
<ul class="nav nav-tabs" id="myTabTabs"><li class="active"><a href="#details" data-toggle="tab">Edit Contact</a></li><li class=""><a href="#misc" data-toggle="tab">Miscellaneous Information</a></li><li class=""><a href="#attrib-display" data-toggle="tab">Display</a></li><li class=""><a href="#attrib-email" data-toggle="tab">Form</a></li><li class=""><a href="#publishing" data-toggle="tab">Publishing</a></li></ul>
displayed in com_content but missing in com_contact
<li class=""><a href="#attrib-fields-0" data-toggle="tab">Fields</a></li>
any news ? :-)
I need to test that, sorry for the late response, but I was occupied with some other things.
no problem ... I wasn't sure if you had seen my replies, thanks for your work
I'v just tested it with the latest code from staging and it worked. Here is a screenshot about my form
And here the raw output which will be sent by mail
This is an enquiry email via http://joomla.box/cms/ from:
Test <test@test.com>
Demo
Dep: Accounting, Development
So I suggest that you are doing a new installation of the most actual Joomla code and then redo the test again.
Can we close this one?
I guess we can close this one as, as I and other have been testing contacts extensively in the last weeks.
Closing as there was no response.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-01-26 08:39:20 |
Closed_By | ⇒ | Bakual |
the new fields are disabled
Check the permissions for the field!
Thanks but what should be the permissions ? that it works as expected for everybody
ok now it works but if I get the email the custom field is displayed in that way
<div class="field-container" data-alias="">
<span class="field-label">telefon: </span>
<span class="field-value">0</span>
</div>
`
how can I customize the email ?
thank you
That doesn't really makes sense. Can you open please a new issue which describes the problem and what do you expect for the fields? Thanks.
I have really no idea how works Github and where to open a new issue
Goto https://issues.joomla.org
On 1 May 2017 6:38 p.m., "ymages" notifications@github.com wrote:
I have really no idea how works Github and where to open a new issue
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#12673 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8bVbu6fEdDL7mh51GvYPSPSH_h_aks5r1hiCgaJpZM4Kl4Rw
.
thanks
Warning: SimpleXMLElement::__construct(): Entity: line 2: parser error : Entity 'auml' not defined in /libraries/joomla/form/form.php on line 728
Warning: SimpleXMLElement::__construct(): ZahnarztZahnä in /libraries/joomla/form/form.php on line 728
Warning: SimpleXMLElement::__construct(): ^ in /libraries/joomla/form/form.php on line 728
Please open a new issue with the steps to reproduce your error. Make sure you are using the 3.7 final version. Thanks.
I am using the 3.7 final version
if you write a char like ä or a letter with any accent on custom field type list you get that error
line 728 = $data = new SimpleXMLElement($data);
Can somebody lock that issue please?
locked as requested
Did you switch to contact form context Mail?