title: Passing the ID of a blog entry to a blog holder method
body: <p>I am using the blog module for SilverStripe. Within the blog holder template there is a loop which loops over each blog entry. I can't run any methods from blog entry in this loop, i can only run blog holder methods. So.. I want to pass the ID of the current blog entry to the blog holder method I have written so I can retrieve the AuthorID (custom field I added) from the blog entry.</p>
  
  <p>I have tried </p>
  
  <p><strong>BlogHolder.php</strong></p>
  
  <pre><code>function getAuthor($identity) {
      $Author = DataObject::get_by_id('Person', $identity);
  }
  </code></pre>
  
  <p><strong>BlogHolder.ss</strong></p>
  
  <pre><code>&lt;p id="author-tag"&gt;By $getAuthor($ID)&lt;/p&gt;
  </code></pre>
  
  <p>I have also tried to pass a direct integer for testing purposes and this also returned an error about the $identity variable being undefined, so it seems nothing is actually being passed to the method at all.</p>
  
  <p>The error I receive is</p>
  
  <blockquote>
    <p>[Warning] Missing argument 1 for BlogHolder_Controller::getAuthor(), called in /var/www/sites/quadra/framework/view/ViewableData.php on line 108 and defined</p>
  </blockquote>
  
  <p>as well as</p>
  
  <blockquote>
    <p>[Notice] Undefined variable: identity</p>
  </blockquote>
  
  <p>and also..</p>
  
  <blockquote>
    <p>[User Warning] DataObject::get_by_id passed a non-numeric ID #DataList</p>
  </blockquote>
  
  <p>So the question here really is: Within the blog entries loop in the blog holder template, how can I pass the ID of the current blog entry to a method within the blog holder controller.</p>
  
  <p>Thanks guys.</p>