Echo of Page Owner on site
Permalink Browser Info Environment
I am trying to print the page owner name underneath the blog article but only get my own name back and not that from an other blogposter.
I' am using the following snippet:
<?php echo $c->getVersionObject()->getVersionAuthorUserName(); $userName ?>
Any help will be welcome.
I' am using the following snippet:
<?php echo $c->getVersionObject()->getVersionAuthorUserName(); $userName ?>
Any help will be welcome.
Type: | Discussion |
---|---|
Status: | New |
Thanks Ryan,
That make's sence :)
That make's sence :)
I was attempting to get the page owner underneath my blog entry but post it as the page owner and not the current logged in user. As I was asked to post a blog entry as another user.
My immediate thought was to create an author page attribute but instead I am able to use the page owner to get the same result.
I used the following to achieve this. Ill post it here, as this was the best match to my problem when searching.
My immediate thought was to create an author page attribute but instead I am able to use the page owner to get the same result.
I used the following to achieve this. Ill post it here, as this was the best match to my problem when searching.
$ui = UserInfo::getByID($c->getCollectionUserID()); $display_name = $ui->getAttribute('display_name'); //user attribute
Hi TheRealSean,
I'm looking for exactly the same solution that you were going for, as we are trying to display the page owner as the author within our blog. The trouble is: I don't get your solution to work. Where did you put the snippet you posted? Asked in another way: How does the complete implementation have to look like in order to work?
Regards
I'm looking for exactly the same solution that you were going for, as we are trying to display the page owner as the author within our blog. The trouble is: I don't get your solution to work. Where did you put the snippet you posted? Asked in another way: How does the complete implementation have to look like in order to work?
Regards
I'm pretty sure PB defaults to the page owner if no author is present in the content view. so simply remove the author and it should display author info as the page owner.
Chad
Chad
<?php echo $c->getVersionObject()->getVersionAuthorUserName(); ?>
and that should do the trick.