Please read and follow the COMMON ISSUES first!
Always add your version information in every new post! Thank you!

Form2Content Forum

Questions and answers for Form2Content, a Joomla CCK.
  1. istofir
  2. F2C Search front-end
  3. Monday, July 25 2016, 08:04 AM
  4.  Subscribe via email
Hi I would like to customize the search form, I made a overrie modern.php of view but I notice that the labels are not tied to a single dynamic class field, and in doing so they imposed one by adding the id of the field put the same type of class to all the label. How can I fix? I wish I could set the form view by positioning the individual fields and label it at my leisure.
Accepted Answer
Julien Accepted Answer
You can accomplish this with a little hack.

Edit this file: <your site>/modules/mod_form2contentsearch/helper.php
On line #62 you'll see:

$element 			= new JObject();
$element->caption = self::stringHTMLSafe($searchField->caption);


add a line in between like this:

$element = new JObject();
$element->id = $searchField->id;
$element->caption = self::stringHTMLSafe($searchField->caption);


Now goto your override of modern.php and change line #77 into this:

<label class="search_label_<?php echo $element->id; ?>"><?php echo $element->caption; ?></label>


You will now have each label unique for each field by using its Id.

For example for the field with id = 12 the class will be search_label_12

Hope this helps.

best,
Julien
  1. more than a month ago
  2. F2C Search front-end
  3. # Permalink
Responses (6)
Julien Accepted Answer
Hi,

I'm not sure I understand what you mean. Do you mean that you want to position the labels independant of the controls?
Now the module is displayed by looping through the controls and outputting each label and control.

If you want to have more control you could hard-code the lay-out of a form by removing the loop and handling the lay-out yourself by addressing the controls and labels. You could make it semi-dynamic by only doint this for a specific form.

Does this answer your question?

best,
Julien
  1. more than a month ago
  2. F2C Search front-end
  3. # 1
istofir Accepted Answer
I try to explain myself better, I wish the search form in particular this code:

< label >



Can have the label with a class tied to the individual label field then:




< label class="CLASSE_NOMECAMPO"></ label>


or place I individual label and related input fields and thus customize the look but do not know how to call them ..

type:
< div>
<l abel class="CAMPO_NOME"></l abel>
< in put id="campo_nome" class="inputbox F2cSearchFreetextField" type="text" name="nome">
</ div>
  1. more than a month ago
  2. F2C Search front-end
  3. # 2
istofir Accepted Answer
No one can help me? I do not know if I have explained, I wish that each label had a CSS class related to the field that indicates or can I insert labels and input to the individual fields but do not know how to do.

Thanks
  1. more than a month ago
  2. F2C Search front-end
  3. # 3
istofir Accepted Answer
Great, thanks. It works perfectly.

I take this opportunity, and I ask how can I make them appear to select fields empty, charge me right away the first option but I wish it was empty. I popped the administrative side to leave empty value but nothing loads still the first option

Thank you
  1. more than a month ago
  2. F2C Search front-end
  3. # 4
Julien Accepted Answer
Hi,

What do you mean?
Do you want the first option in a select field empty, like the text "Please select a value" or something similar?

best,
Julien
  1. more than a month ago
  2. F2C Search front-end
  3. # 5
istofir Accepted Answer
Hello Julien I solved.
Thank you
  1. more than a month ago
  2. F2C Search front-end
  3. # 6
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.