Fatal Error on blog_entry.php
Permalink
I wanted my blog pages to display the blog author's name so I created a text attribute called "author". I then changed in blog_entry.php
By <?php echo $userName; ?>
to
By <?php $c = Page::getCurrentPage();
$uID = $c->getCollectionUserID();
$ui = UserInfo::getByID($uID);
print $ui->getAttribute('author'); ?>
and it works fine. You can see it in action here:
http://www.knowleskreative.com/blog/dont-hire-web-designer-you-need...
However, when I go to Dashboard -> Pages & Themes -> Page Types
and click on Defaults for blog_entry I get the following error:
Fatal error: Call to a member function getAttribute() on a non-object in /home5/keithkno/public_html/knowleskreative/themes/default/blog_entry.php on line 40
If I revert the lines of code above the error goes away but so does my author's name from the blog article.
Can this be fixed?
Thanks.
By <?php echo $userName; ?>
to
By <?php $c = Page::getCurrentPage();
$uID = $c->getCollectionUserID();
$ui = UserInfo::getByID($uID);
print $ui->getAttribute('author'); ?>
and it works fine. You can see it in action here:
http://www.knowleskreative.com/blog/dont-hire-web-designer-you-need...
However, when I go to Dashboard -> Pages & Themes -> Page Types
and click on Defaults for blog_entry I get the following error:
Fatal error: Call to a member function getAttribute() on a non-object in /home5/keithkno/public_html/knowleskreative/themes/default/blog_entry.php on line 40
If I revert the lines of code above the error goes away but so does my author's name from the blog article.
Can this be fixed?
Thanks.
Try that out.