Hello and thank you for your module.
Can anyone be so kind as to point at a possible way I might be able to reference other fields that I am mapping to my feed node?
for example, if I have a 'field1' and 'field2', can I use php code (in feeds tamper php) for 'field1', to reference the value I have for 'filed1'?
I know $item and $field are available. But can I do something like:
if field1 == 'news feed' then return '
'.$field.'
';
---
I am trying to use querypath to import html from various pages that each have a unique div structure.
Thanks for reading!
Comments
Comment #1
meStePlease, read before posting.
Also, it's worth to mention that this module is made for DEVELOPERS, not for end users. You really shouldn't use it unless you know what you're doing.
Comment #2
timfelix commentedThank you meSte,
I worded my question poorly.
Basically, I'm trying to change my queryPath expression (css selector) based on the value of another filed in my feed node.
so if the node I am updating has another field 'field_feed_type' with value 'NEWS' then my queryPath selector should equal 'div.newsText'.. and if 'field_feed_type' == 'ARTICLE' then queryPath selector is div.articleText
I'll keep looking for an approach.. this may not be related to feeds tamper php.
Comment #3
meSteThis module just exposes two variables: $field and $item. $field is the current field being tampered and $item is a keyed array with all the fields read by Feeds, altered by Feeds Tamper and about to be imported (created or updated).
I really don't think it's related to your issue.
First of all: are you using Feeds to import those (i guess) HTML pages?
Have you tried QueryPath and Feeds QueryPath Parser?
Comment #4
timfelix commentedhey meSte,
Thank you for your advice. This helped.
The $item array has everything I need.
Comment #5
meSteComment #6
honza pobořil commentedI think $item should be mentioned in GUI in description of PHP code field. (Currently there is described only $field variable.)
Comment #7
meSteComment #8
meSte$item should definitely be mentioned in the PHP code field description.
Comment #9
geek-merlinYes, really.
Setting active, as needswork implies there is already a patch.
Comment #10
geek-merlinNote: this should really be called $fields...
Comment #12
meSte