I am running v4.2.0 Developer I have setup extra fields under the category menu in admin, I then added a new listing with values inside the extra fields but when I try and display them on a custom viewlisting.tpl file using the following code: {get_extra_field id=$view fid=1} I get the following error message: Notice: Query failed: Query was empty SQL: in /home/purebri/public_html/includes/classes/database/mysql.php on line 143 But when using the standard template code for the extrafields, they values display correctly. Any ideas? Thanks in advance.
A couple of things: Are you sure that you have the correct field ID? What do you mean when you say, "standard template code for the extra fields"? The extra fields in the default templates are in an associative array from the original query for the listing If you mean you tried the same plugin {get_extra_field id=$view fid=1}, then I have no explanation for that at all. Have you actually tried using the plugin call in the default template??? If that also fails, then chances are the plugin file itself is corrupted.
Yes I am using the correct field ID, i have 3 setup and none are displaying values. I meant that I used the original standard template to check the data was being pulled correctly: Code: {* Extra Fields *} {foreach from=$extrafields item=extras} <table width="100%" border="0" cellspacing="5" cellpadding="0"> <tr> <td width="300"><strong>{$extras.title}:</strong></td> <td> {if isset($extras.value)} {foreach key=key item=item from=$extras.value} {$item|nl2br}<br /><br /> {foreachelse} {$extras.value} {/foreach} {/if} </td> </tr> </table> {/foreach} {* End Extra Fields *} This above works correctly
OK, so follow what I already posted above. Try the plugin call in the default template. If that fails, then your plugin file is most likely corrupted and you need to reupload it. Or check the plugin file directly.
Tried your suggestions, nothing worked. Only way I can get it to work is to use the following format: Code: {get_extra_field id=$view name="Field_name_not_ID"} Some using the name and not ID solved it!