Jump to content
astock

Show username on frontend who insert a repeater item

Recommended Posts

Hi,

is it possible to show the user on frontpage who added a repeater item to a page?

With

$page->createdUser;

only the creator of the Page is displayed, not the creator of the repeater item(s).

Thanks in advance!

Share this post


Link to post
Share on other sites

Somewhere in your template code you loop through your repeater items. There you have each of them as a Page, but with your own given name. This $variableWithYourCustomName is a PageObject and has all the properties and methods that you know from the global $page variable, that holds the current page. Have you tried $yourNameForRepeateritem->createdUser ?

  • Like 1

Share this post


Link to post
Share on other sites

Hi @horst, yes, but with $myrepeateritem->createdUser; the output is empty.

Share this post


Link to post
Share on other sites

Ahh ... I have it! I have a double loop through the repeter items to iterate the single items (files) on the page. But to show the creator on the item only the first loop is relevant. Thanks for the food for thought!

  • Like 1

Share this post


Link to post
Share on other sites

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...