I would like to:

-reference another node field from the filters (for example width / hight values and link to an swf to build the html code to display the swf).
-reference another feed value from the filters (same example as above, but without the need to first save them as seperate fields before they can be accessed)

can this be done currently or implemented?

Comments

Sorin Sarca’s picture

-reference another node field from the filters

You may now use in your filter function FeedImport::$current object which is a reference to current importing item (just added it to dev).

reference another feed value from the filters

I don't know what you want to do here.
You want to use some info from previous processed items? If so, this is somehow not possible because if you have a huge feed previous items will be deleted after save to free memory.

Please use an example so we can find a solution.

rdlang’s picture

I think it is fine as is, just am not sure how to use it?

Can you give an example?

Sorin Sarca’s picture

Let's assume that we already know the text and url and we want to create a link.

function create_html_link($field) {
  $current = &FeedImport::$current;
  return l($current->text, $current->url);
}
Sorin Sarca’s picture

Status: Active » Closed (works as designed)
q2_faith’s picture

I have field "Link", and two elements 'url' and 'title'(in xml two strings). how I can use FeedImport::$current?

q2_faith’s picture

Status: Closed (works as designed) » Active
Sorin Sarca’s picture

There is a simple example in #3 --a function used as filter. You cannot use FeedImport::$current in UI.
Assuming that Link field has two columns: "text" & "href" and you already extracted those values in your current item, you can write a filter function which you'll use in UI.

function MY_MODULE_get_curret_link() {
    $current = &FeedImport::$current;
    return (object) array(
      'text' => $current->title, //assumes that you alread extracted title
      'href' => $current->location, //same for this
    );
}

Anyway, please give me more info about what you want to do (so I can help you).

q2_faith’s picture

I have field link provided by module http://drupal.org/project/link
and has the following structure
field_post_link array(
und array(
0 array(
url => http://blogurl.com,
title => blog name)))
in xml files I has following structure

<blogName>blog name</blogName>
<blogUrl>http://blogurl.com</blogUrl>

how I can import "title" and "url" together?
sorry for my English)

Sorin Sarca’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

xpath sould be: blogName | blogUrl