1

I am new in expression engine , in my project i have to fix some bugs, used here EE1

I have two weblogs , elections and school - In election weblog used one field 'election_school_id' , and this 'election_school_id' is the id of weblog of 'school' . I need retrive postcode of school using this id , my code is displaying below,

{exp:weblog:entries weblog="election" search:election_id="{segment_3}" dynamic="off"}

    postcode = "{exp:replace find='\n' multiple='yes' regex='yes'}{exp:get_data weblog='school' id='{election_school_id}' field='{school_postcode}'}      {/exp:replace}";

{/exp:weblog:entries}

In this used {exp:get_data} is searched on Google , but i didn't get any results.

I searched the word get_data in the filesystem, then I got the file 'system/plugins/pi.get_data.php' and function like

function Get_data() { global $TMPL;

$weblog = $TMPL->fetch_param('weblog');
$id = $TMPL->fetch_param('id');
$field = $TMPL->fetch_param('field');

//echo("field: " . $field . " required for entry id: " . $id); 
if ($field == 'title') $this->return_data = $this->get_entry_title_by_id($id);
else $this->return_data = $this->get_field_data($field,$id);    
}
4
  • 1
    Is {exp:get_data} a custom module ? I believe you'll have to use an embed to get what you're after Mar 12 '15 at 7:15
  • Yes. I searched the word get_data, then I got the file 'system/plugins/pi.get_data.php'
    – Anu
    Mar 12 '15 at 7:21
  • Anu, I updated your original question with the details that you posted as an answer.
    – Alex Kendrick
    Mar 12 '15 at 15:29
  • 1
    I'm no expert on plugin logic but I believe that code is looking for a title not an id. Mar 13 '15 at 1:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.