I have the following XML:
<nodes>
<node>
<title>Test Org - Pleae Ignore</title>
<logo>
<enclosure url="https://www.mydomain.org/sites/default/files/louis%20xiv.jpg" length="71280" type="image/jpeg" />
</logo>
</node>
<node>
<title>Test Org - Pleae Ignore</title>
<logo>
<enclosure url="https://www.mydomain.org/sites/default/files/louis%20xiv.jpg" length="71280" type="image/jpeg" />
</logo>
</node>
<node>
<title>Test Org - Pleae Ignore</title>
<logo>
<enclosure url="https://www.mydomain.org/sites/default/files/louis%20xiv.jpg" length="71280" type="image/jpeg" />
</logo>
</node>
</nodes>
And the following template markup:
{% set params = {
url: 'https://www.domain.org/xml-details?nid=12345',
type: 'xml',
element: 'node',
cache: 60,
} %}
{% set feed = craft.feedme.feed(params) %}
{% for node in feed %}
{{ node.title }}
{{ node.logo.enclosure.attributes.url }}
{% endear %}
{{ node.title }}
displays fine, but {{ node.logo.enclosure.attributes.url }}
displays nothing.
Based on other threads I've read, I've also tried {{ node.logo.enclosure['@url'] }}
Neither returns the value of the url
attribute.
Any help getting this to work is appreciated.
EDIT: Using just {{ node.logo }}
in the template outputs <enclosure url="https://www.mydomain.org/sites/default/files/louis%20xiv.jpg" length="71280" type="image/jpeg" />
.
EDIT: Here's my {{ dump(node) }}
output.
array(30) {
["recordId"]=>
string(5) "19795"
["title"]=>
string(22) "Robertson Blood Center"
["summary"]=>
string(101) "<p>Volunteer- Donate blood. Your donation of life is used by wounded military at home and abroad.</p>"
["logo"]=>
string(156) "<enclosure url="https://www.mydomain.org/sites/default/files/1959440_10152076927213038_3915913252856478361_n%5B1%5D_2.jpg" length="35608" type="image/jpeg" />"
}
{{ node.logo}}
to see if it contains the property enclosure and continue with that until you reachattributes
– Robin Schambach Nov 10 '17 at 5:43{{ node.logo }}
does, indeed, display the full<enclosure />
element. So the content is there. I just can't get FeedMe to parse it. – Philip Jones Nov 10 '17 at 12:22