heldercervantes Posted October 11, 2017 Share Posted October 11, 2017 I'm implementing something with field rendering. The approach goes through a RepeaterMatrix, there's a PHP file for each type of repeater block, etc. When rendering a given field, in that template's file I need to reference the actual page, to ultimately grab its children. How is that done? I'm finding nothing in the docs. Link to comment Share on other sites More sharing options...
abdus Posted October 11, 2017 Share Posted October 11, 2017 https://processwire.com/blog/posts/more-repeaters-repeater-matrix-and-new-field-rendering/#processwire-3.0.5-introduces-field-rendering-with-template-files Quote Also worth mentioning is that each field template file receives all of ProcessWire's API variables. It also receives these in addition to that: $value - The value that needs to be rendered $page - The page that $value lives on $field - The field representing $value (of class Field) if you want it 2 Link to comment Share on other sites More sharing options...
Zeka Posted October 11, 2017 Share Posted October 11, 2017 Hi @heldercervantes You can use getForPage method. 3 Link to comment Share on other sites More sharing options...
heldercervantes Posted October 11, 2017 Author Share Posted October 11, 2017 1 minute ago, Zeka said: You can use getForPage method. Precisely! Thank you Zeka, you've just saved my life. 1 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