HI jiipsijack,
My developer is out on vacation for a bit so I’ll have to defer this to him when he returns.
Thanks for such a prompt reply, I look forward to hearing from him.
Hi there, Sorry to inundate but I see that your developer is back as other support queries have been resolved, was just wondering whether any ground has been made on this? Really need to get it sorted and I can’t figure it out by myself unfortunately, Thanks Again.
Got an answer for you here:
Is there any way of differentiating between different fields? for example some type of Query against row number etc?
Unfortunately we don’t have a way to control the output of individual fields of the same type (I believe he is using two textfields). However, since he is already modifying the plugin’s code, he can use $field->field_name to check which field is being processed and apply the google maps modifications to one field and the keyword modifications to the other.
Hi there, thanks again for your reply, while I appreciate your confidence in my coding abilities, unfortunately I’m not certain how to use $field->field_name to differentiate the fields. I see this line 30 times in awpcp_extra_fields_module.php. If you could tell me how to use it to see which field is being processed I’m sure I could figure the rest out with that as a starting point. And you are correct, it is two text fields.
Thanks in advance.
Hi jiipsijack,
If the code aspect seems a bit daunting, we would recommend that you hire a developer on oDesk to help with this kind of customization. There are a number of PHP/WordPress guys on there at reasonable prices: http://odesk.com
It doesn’t seem daunting, all I really need is a starting point so if you wouldn’t mind explaining how to use the $field->field_name to differentiate, I’m sure I can figure the rest out myself. Thanks once again for your time.
The field name is the name of the field defined in your AWPCP Extra Fields admin. So you’d have to use some kind of conditional in the code to customize the behavior or output per field. Something like this:
if ($field->field_name == "my_field") {
//Do map-specific for just my_field
}
else {
//Regular output for other fields
}
Fantastic! Thank you so much for your help, The support for this plugin really is great. I’ll give this a whirl and let you know how it works out.
It’s worked! I’ve differentiated between fields now and my address field is showing up as a link while my keywords field is showing up hidden in listings, just like I wanted
For anyone else trying something similar the code I used looks like:
`else if (count($value) > 0 && $field->field_name == “address”) {
$value = awpcp_extra_fields_render_field_single_value($field, $value[0]);
$html .= sprintf( ‘<span class=”awpcp-extra-field-value”><address>%s</address></span>’, $value );
} else if (count($value) > 0 && $field->field_name == “keywords”) {
$value = awpcp_extra_fields_render_field_single_value($field, $value[0]);
$html .= sprintf( ‘<span class=”awpcp-extra-field-value”><font color=”white”>%s</font></span>’,`
However I didn’t realise that the search form doesn’t recognise the content of extra fields unless I have a search section specifically for that. Is there any way that I can change the search form so it will read from “ad title” “ad details” and my extra field? If you like I can start a new Forum question as this is sort of a different question now.
Yes, please start a new thread for this. And when you do, please post a screenshot of what you are seeing on your search screen.