bwakad Posted May 7, 2014 Share Posted May 7, 2014 I would like to see the code used in the admin for the menu - user part. Does anyone know where to look for that? Link to comment Share on other sites More sharing options...
Soma Posted May 7, 2014 Share Posted May 7, 2014 Like the topmenu? https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/AdminTheme/AdminThemeDefault/AdminThemeDefaultHelpers.php#L269 Link to comment Share on other sites More sharing options...
bwakad Posted May 7, 2014 Author Share Posted May 7, 2014 I did not find what i was looking for in there. I guess I searched in wrong area... What I need is a way to show a user's name which created a page. $user is only reffering to the current user (guest or logged in). But I need a way to show the name independent of logged in or not. I know I can do this: $myid = $child->get(created_users_id); echo $myid; But I do not know exactly how to access that page to get the name of the user. Think I have found the answer in the API... (sorry). I hope this is the fastest way to do this though: $myname = $users->get("id=$myid"); echo $myname->name; Link to comment Share on other sites More sharing options...
adrian Posted May 7, 2014 Share Posted May 7, 2014 all you need is: echo $child->createdUser->name; assuming you have already set $child to the page in question. For the current page: echo $page->createdUser->name; Link to comment Share on other sites More sharing options...
kongondo Posted May 7, 2014 Share Posted May 7, 2014 (edited) echo $page->createdUser->name; Adrian beat me to it...OK, so am slow...nothing new there Edited May 7, 2014 by kongondo 1 Link to comment Share on other sites More sharing options...
bwakad Posted May 7, 2014 Author Share Posted May 7, 2014 heyyyy, that's even more easy then I thought. Can't believe I was goign for the difficult road. Thanks so much! So, where did you all found this code - where to look? Again sorry - I had to look under $page, while I was searching under $user/$users/$roles... Link to comment Share on other sites More sharing options...
kongondo Posted May 7, 2014 Share Posted May 7, 2014 Thanks to Soma, we have this: http://cheatsheet.processwire.com/ 1 Link to comment Share on other sites More sharing options...
adrian Posted May 7, 2014 Share Posted May 7, 2014 It's right there in the cheatsheet OK, so your turn to beat me this time! 1 Link to comment Share on other sites More sharing options...
kongondo Posted May 7, 2014 Share Posted May 7, 2014 (edited) ......Again sorry - I had to look under $page, while I was searching under $user/$users/$roles... Or you can use the search box on the cheatsheet page... Edited May 7, 2014 by kongondo Link to comment Share on other sites More sharing options...
bwakad Posted May 7, 2014 Author Share Posted May 7, 2014 But as always - everyone is friendly enough to help. I will study the cheatsheet more - don't want to see any of you loose 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