Jump to content

find template=repeater_


tkam
 Share

Recommended Posts

Hey guys,

I have a repeater field called "products", which I use in a template called "series". There are several pages with the series template.
Now i'd like to make an ajax call to get all repeater items from the series pages, which works fine as long as I am logged in.

When I am logged out, this does not work:

$pages->find("template=repeater_products");

Any idea why?

Thanks, 

Tom 

Link to comment
Share on other sites

Ok, same as always... first I don't find a solution, then after a long while of searching I sign on for the forum to post a question.
Minutes later I find the solution myself. ?

$pages->find("template=repeater_products, check_access=0");

This does the trick. Can someone explain why?

Thanks,

Tom

Link to comment
Share on other sites

Repeaters are pages placed under the admin which users of role "guest" cannot access due to the way access control works. It's a bit confusing because you don't think of repeater elements as pages per se, but since they actually are that, the same rules as for the rest of the pages apply, they are kind of "admin pages"

Hope I made myself clear!

  • Like 2
Link to comment
Share on other sites

If you are going to retrieve them using find() you will have to use check access, another possibility I can think of tight now is:

$pages->find('template=series')->explode('products');

But I guess not as practical because it returns an array of WireArrays.

Link to comment
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
 Share

  • Recently Browsing   0 members

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