Theming Drupal 7 Nodes and Fields

Submitted by superadmin on Fri, 03/25/2011 - 21:05

From the template file: Field variables: for each field instance attached to the node a corresponding variable is defined, e.g. $node->body becomes $body. When needing to access a field's raw values, developers/themers are strongly encouraged to use these variables. Otherwise they will have to explicitly specify the desired field language, e.g. $node->body['en'], thus overriding any language negotiation rule that was previously applied.

Twitter API - Simplepie Profile Image

Submitted by superadmin on Fri, 03/25/2011 - 20:57

We used the simpliepie library to access the Twitter API recently and ran in to an issue trying to access the image link field from the XML.

This is the image link that gives you a direct link to the twitter users profile picture.

Using the get_link() function would only return the link to the users profile. After reading the API manual we used:

get_link(0, 'image'); >

And our problem was solved.

Subscribe to 207king.com RSS