Jump to content

creators username


martind
 Share

Recommended Posts

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

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

  • Like 1
Link to comment
Share on other sites

  • 6 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...