Impossible to access an attribute (title) on a string variable I have a Video section with a field called videoCategory. I'm trying to pull in the first category on the _entry.html template.

I'm pretty much following the the last example in the documentation at: http://buildwithcraft.com/docs/categories-fields

...with this code:

 {% set entryCategory = entry.videoCategory.first() %}
 {% if entryCategory %}
   &lt;h1&gt;{% for category in entryCategory %}&lt;a href=""&gt;{{ category.title }}&lt;/a&gt; {% endfor %}&lt;/h1&gt;
 {% endif %}


But I can't get around this error message:


  Impossible to access an attribute ("title") on a string variable ("19")


What is it that I'm missing?
entryCategory is already a single category because of "first()". So no need for the for loop. Just {{ entryCategory.title }} should do the trick here.

{% set entryCategory = entry.videoCategory.first() %}
{% if entryCategory %}
    &lt;h1&gt;&lt;a href=""&gt;{{ entryCategory.title }}&lt;/a&gt;&lt;/h1&gt;
{% endif %}