tkam Posted July 27, 2020 Share Posted July 27, 2020 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 More sharing options...
tkam Posted July 27, 2020 Author Share Posted July 27, 2020 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 More sharing options...
elabx Posted July 27, 2020 Share Posted July 27, 2020 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! 2 Link to comment Share on other sites More sharing options...
tkam Posted July 27, 2020 Author Share Posted July 27, 2020 Alright, thanks! I should read a bit more about access control. Is there a way to make the repeaters accessible as guest without using check_access=0 ? Link to comment Share on other sites More sharing options...
elabx Posted July 27, 2020 Share Posted July 27, 2020 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 More sharing options...
tkam Posted July 28, 2020 Author Share Posted July 28, 2020 Ok and yes you are right, the other way is more practical. 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