HI i have created a content type call "mycontent"

it has 2 fields

Label: MyText , Name: mytext , type: Text
Label: MyImage , Name: myimage , type: Image

All good so far, I have create a custom theme and inside this i have included

'node-mycontent.tpl.php'

my quesiton is, how do i get at the variables.

I wish to $mytext

I can render global variables ie $content

Comments

nevets’s picture

In general, if your field is names 'yourdata' you can access if as $node->field_yourdata[0]['view']. If you allow multiple values you would loop through $node->field_yourdata (its an array holding all the values for that field).