I added a field on the page content type called 'Page Title' (machine name field_machine_name).
I want to modify the markup for this field on the page. The default markup is something like this:
<div>
<div>
<div>FIELD VALUE</div>
</div>
</div>
I want it the markup to be
<div>
<div></div>
<div>FIELD VALUE</div>
<div></div>
</div>
I tried creating a file in my templates folder called field--field_page_title.tpl.php
, but I'm not sure how to print the value of the field.
Check the documentation on field.tpl.php. Looks like the info you want will be in the $items
array.
If you're not sure how that array is structured, the devel module will help you. Or you can just tell your template to dump the contents of the array onto the page (or into a log file) and find out what it looks like that way.