<p>I'm not sure what <code>submissions</code> is, but <code>submits</code> inside your loop is an array so you can access its values using <code>submits['blog_name']</code>.</p>

CC BY-SA 3.0
2016-05-20T18:25:10.967Z
For `submits[blog_name]` the error is:
**Variable "blog_name" does not exist**
JMP
CC BY-SA 3.0
2016-05-20T18:26:32.967Z
What is `craft.tumblr.submissions` using? I can then try and replicate and test to provide a better answer.
Luke Pearce
CC BY-SA 3.0
2016-05-20T18:27:52.127Z
@LukePearce think you were just missing the quotes in your answer.  Should be `submits['blog_name']`. @JMP
Brad Bell
CC BY-SA 3.0
2016-05-20T18:30:27.313Z
haha of course - that's what you get trying to work things out without code editor highlighting!
Luke Pearce
CC BY-SA 3.0
2016-05-20T18:31:27.987Z
`<li>{{ dump(submits[key]['blog_name'])  }}</li>` gives this error:
**Key "1" for array with keys "blog_name, id, post_url, slug, type, date, timestamp, state, format, reblog_key, short_url, summary, recommended_source, recommended_color, followed, is_anonymous, anonymous_name, anonymous_email, is_submission, liked, note_count, title, url, link_author, excerpt, publisher, can_send_in_message, can_reply" does not exist**
JMP
CC BY-SA 3.0
2016-05-20T18:33:04.453Z
Just take away the [key] bit
Luke Pearce
CC BY-SA 3.0
2016-05-20T18:22:02.350Z
2016-05-20T18:27:06.610Z
2016-05-20T18:27:06.610Z
Luke Pearce
<p>I'm dumping this var but cant nail down this error:</p>

<pre><code>{% set submissions = craft.tumblr.submissions %}
&lt;ul&gt;
    {% for key,submits in submissions %}
        // KEY GIVES ERROR 1
        &lt;li&gt;{{ dump(submits.key)  }}&lt;/li&gt;
        &lt;hr&gt;
        // BLOG_NAME GIVES ERROR 2
        &lt;li&gt;{{ dump(submits.blog_name)  }}&lt;/li&gt;
    {% endfor %}
&lt;/ul&gt;
</code></pre>

<p>Error 1:</p>

<blockquote>
  <p>Key "key" for array with keys "blog_name, id, post_url, slug, type, date, timestamp, state, format, reblog_key, short_url, summary, recommended_source, recommended_color, followed, is_anonymous, anonymous_name, anonymous_email, is_submission, liked, note_count, title, url, link_author, excerpt, publisher, can_send_in_message, can_reply" does not exist</p>
</blockquote>

<p>Error 2:</p>

<blockquote>
  <p>Method "blog_name" for object "Twig_Markup" does not exist</p>
</blockquote>

<p>Thoughts?</p>

<p>EDIT: Adding scheme for <code>craft.tumblr.submissions</code>:</p>

<pre><code>array(7) {
  [1]=&gt;
  array(28) {
    ["blog_name"]=&gt;
    array(1) {
      [0]=&gt;
      string(11) ""
    }
    ["id"]=&gt;
    array(1) {
      [0]=&gt;
      int()
    }
    ["post_url"]=&gt;
    array(1) {
      [0]=&gt;
      string(64) ""
    }
    ["slug"]=&gt;
    array(1) {
      [0]=&gt;
      string(23) ""
    }
    ["type"]=&gt;
    array(1) {
      [0]=&gt;
      string(4) ""
    }
    ["date"]=&gt;
    array(1) {
      [0]=&gt;
      string(23) ""
    }
    ["timestamp"]=&gt;
    array(1) {
      [0]=&gt;
      int()
    }
    ["state"]=&gt;
    array(1) {
      [0]=&gt;
      string(10) ""
    }
    ["format"]=&gt;
    array(1) {
      [0]=&gt;
      string(4) ""
    }
    ["reblog_key"]=&gt;
    array(1) {
      [0]=&gt;
      string(8) ""
    }
    ["short_url"]=&gt;
    array(1) {
      [0]=&gt;
      string(30) ""
    }
    ["summary"]=&gt;
    array(1) {
      [0]=&gt;
      string(23) ""
    }
    ["recommended_source"]=&gt;
    array(1) {
      [0]=&gt;
      string(11) ""
    }
    ["recommended_color"]=&gt;
    array(1) {
      [0]=&gt;
      string(11) ""
    }
    ["followed"]=&gt;
    array(1) {
      [0]=&gt;
      bool(false)
    }
    ["is_anonymous"]=&gt;
    array(1) {
      [0]=&gt;
      bool(true)
    }
    ["anonymous_name"]=&gt;
    array(1) {
      [0]=&gt;
      string(13) ""
    }
    ["anonymous_email"]=&gt;
    array(1) {
      [0]=&gt;
      string(30) ""
    }
    ["is_submission"]=&gt;
    array(1) {
      [0]=&gt;
      bool(true)
    }
    ["liked"]=&gt;
    array(1) {
      [0]=&gt;
      bool(false)
    }
    ["note_count"]=&gt;
    array(1) {
      [0]=&gt;
      int(0)
    }
    ["title"]=&gt;
    array(1) {
      [0]=&gt;
      string(23) ""
    }
    ["url"]=&gt;
    array(1) {
      [0]=&gt;
      string(54) ""
    }
    ["link_author"]=&gt;
    array(1) {
      [0]=&gt;
      string(11) ""
    }
    ["excerpt"]=&gt;
    array(1) {
      [0]=&gt;
      string(11) ""
    }
    ["publisher"]=&gt;
    array(1) {
      [0]=&gt;
      string(11) ""
    }
    ["can_send_in_message"]=&gt;
    array(1) {
      [0]=&gt;
      bool(false)
    }
    ["can_reply"]=&gt;
    array(1) {
      [0]=&gt;
      bool(true)
    }
  }
  [2]=&gt;
</code></pre>

<templating><php>
Twig array key errors
# Twig array key errors

(Asked by: username_0 on 2016-05-20)

I'm dumping this var but cant nail down this error:
{% set submissions = craft.tumblr.submissions %}

    {% for key,submits in submissions %}
        // KEY GIVES ERROR 1
        {{ dump(submits.key)  }}
        
        // BLOG_NAME GIVES ERROR 2
        {{ dump(submits.blog_name)  }}
    {% endfor %}


Error 1:

Key "key" for array with keys "blog_name, id, post_url, slug, type, date, timestamp, state, format, reblog_key, short_url, summary, recommended_source, recommended_color, followed, is_anonymous, anonymous_name, anonymous_email, is_submission, liked, note_count, title, url, link_author, excerpt, publisher, can_send_in_message, can_reply" does not exist

Error 2:

Method "blog_name" for object "Twig_Markup" does not exist

Thoughts?
EDIT: Adding scheme for craft.tumblr.submissions:
array(7) {
  [1]=>
  array(28) {
    ["blog_name"]=>
    array(1) {
      [0]=>
      string(11) ""
    }
    ["id"]=>
    array(1) {
      [0]=>
      int()
    }
    ["post_url"]=>
    array(1) {
      [0]=>
      string(64) ""
    }
    ["slug"]=>
    array(1) {
      [0]=>
      string(23) ""
    }
    ["type"]=>
    array(1) {
      [0]=>
      string(4) ""
    }
    ["date"]=>
    array(1) {
      [0]=>
      string(23) ""
    }
    ["timestamp"]=>
    array(1) {
      [0]=>
      int()
    }
    ["state"]=>
    array(1) {
      [0]=>
      string(10) ""
    }
    ["format"]=>
    array(1) {
      [0]=>
      string(4) ""
    }
    ["reblog_key"]=>
    array(1) {
      [0]=>
      string(8) ""
    }
    ["short_url"]=>
    array(1) {
      [0]=>
      string(30) ""
    }
    ["summary"]=>
    array(1) {
      [0]=>
      string(23) ""
    }
    ["recommended_source"]=>
    array(1) {
      [0]=>
      string(11) ""
    }
    ["recommended_color"]=>
    array(1) {
      [0]=>
      string(11) ""
    }
    ["followed"]=>
    array(1) {
      [0]=>
      bool(false)
    }
    ["is_anonymous"]=>
    array(1) {
      [0]=>
      bool(true)
    }
    ["anonymous_name"]=>
    array(1) {
      [0]=>
      string(13) ""
    }
    ["anonymous_email"]=>
    array(1) {
      [0]=>
      string(30) ""
    }
    ["is_submission"]=>
    array(1) {
      [0]=>
      bool(true)
    }
    ["liked"]=>
    array(1) {
      [0]=>
      bool(false)
    }
    ["note_count"]=>
    array(1) {
      [0]=>
      int(0)
    }
    ["title"]=>
    array(1) {
      [0]=>
      string(23) ""
    }
    ["url"]=>
    array(1) {
      [0]=>
      string(54) ""
    }
    ["link_author"]=>
    array(1) {
      [0]=>
      string(11) ""
    }
    ["excerpt"]=>
    array(1) {
      [0]=>
      string(11) ""
    }
    ["publisher"]=>
    array(1) {
      [0]=>
      string(11) ""
    }
    ["can_send_in_message"]=>
    array(1) {
      [0]=>
      bool(false)
    }
    ["can_reply"]=>
    array(1) {
      [0]=>
      bool(true)
    }
  }
  [2]=>

**Tags:** templating, php


---

## 1 answers

### Answer by username_1 on 2016-05-20. Score: 2 | Accepted answer

I'm not sure what `submissions` is, but `submits` inside your loop is an array so you can access its values using `submits['blog_name']`.

> **Comments:**
> **username_0**: For `submits[blog_name]` the error is: **Variable "blog_name" does not exist**  
> **username_1**: What is `craft.tumblr.submissions` using? I can then try and replicate and test to provide a better answer.  
> **username_2**: @LukePearce think you were just missing the quotes in your answer.  Should be `submits['blog_name']`. @username_0  
> **username_1**: haha of course - that's what you get trying to work things out without code editor highlighting!  
> **username_0**: `<li>{{ dump(submits[key]['blog_name'])  }}</li>` gives this error: **Key "1" for array with keys "blog_name, id, post_url, slug, type, date, timestamp, state, format, reblog_key, short_url, summary, recommended_source, recommended_color, followed, is_anonymous, anonymous_name, anonymous_email, is_submission, liked, note_count, title, url, link_author, excerpt, publisher, can_send_in_message, can_reply" does not exist**  
> **username_1**: Just take away the [key] bit  

---

