xml - Add a custom field to joomla contact form -
I am trying to add a custom selection field to the contact form. I am editing the /components/com_contact/models/forms/contact.xml file and the fields are in the following format:
& lt; Field name = "contact_subject" type = "text" id = "contact-emailmsg" size = "60" Description = "COM_CONTACT_CONTACT_MESSAGE_SUBJECT_DESC" label = "COM_CONTACT_CONTACT_MESSAGE_SUBJECT_LABEL" filter = "string" = "string" = "contactemailsubject" required = "true" / & Gt; & Lt; Field name = "contact_message" type = "textarea" cols = "50" rows = "10" id = "contact-message" description = "COM_CONTACT_CONTACT_ENTER_MESSAGE_DESC" label = "COM_CONTACT_CONTACT_ENTER_MESSAGE_LABEL" filter = "safehim" valid = "contact email message" Essential = "true" /> & Lt; Field name = "contact_email_copy" type = "checkbox" id = "contact-email-copy" description = "COM_CONTACT_CONTACT_EMAIL_A_COPY_DESC" label = "COM_CONTACT_CONTACT_EMAIL_A_COPY_LABEL" default = "0" />
My question is how to add a select type field, such as only inputs, tetheraras and checkboxes and nothing in the document can be found
First of all: You should not really be hacking in the main component like this. It's gross and highly dangerous, because you will not be able to ensure that your website is still there after any update. For my knowledge, there is no override method for existing forms for visual templates, so you will end up with two options:
1- Find a custom component where you can configure your field It will be my advice without compromising some code (for example, brieising form)
2- Copy the com_contact component into some com_personalized_contact, and then change the code (Warning: every class has to be renamed, it's very much Which Received) may be.
How to write a selected field: Will answer all your questions
Comments
Post a Comment