Jump to content

Referring to page from field's template


heldercervantes
 Share

Recommended Posts

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

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

 

  • Like 2
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...