martind Posted October 8, 2011 Share Posted October 8, 2011 hi. I`m new on pw and the forum here. First of all, thank you for this great piece of software. I did a bunch of projects on expressionengine and other cms over the last 10 years, but pw lets taste a gentle breeze of revolution. my question: i tried to resolve the username of a page creator from $pages, but had no luck. Any suggestions? $texte = $pages->find("template=submitlist"); foreach($texte as $s) echo "<li><p><a href='{$s->url}'>{$s->title}</a> [{$s->createdUser}".date('d.m.Y H:i:s', $s->created)."]</li>"; thx, martin Link to comment Share on other sites More sharing options...
apeisa Posted October 8, 2011 Share Posted October 8, 2011 Hi Martin and welcome to the forums. $s->createdUser right thing here, but it returns user object (which is actually just a regular page like others), so $s->createdUser->name should return user's login name. Gotta mention here, that user template (=user profile) is also just a normal template, so you can add more fields there too (like firstname, lastname, phone number, image, address etc..) and use those values just as easily: $s->createdUser->firstname 1 Link to comment Share on other sites More sharing options...
martind Posted October 9, 2011 Author Share Posted October 9, 2011 works perfect, thank you. Link to comment Share on other sites More sharing options...
onjegolders Posted April 16, 2012 Share Posted April 16, 2012 Thanks Apeisa, this helped me too. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now