Skip to content

Accessing another box #122

Discussion options

You must be logged in to vote

You can access the current boxes page using the boxesPage variable in Twig. If you are using PHP code, you can find the boxesPage variable set on the controller (i believe the property is named vars).

Once you've got the page, you can access all boxes using the ->boxes relation, and check if your pageTitle box is in there. If so, change the page's title.

Be aware that this logic must be executed somewhere before the page title is rendered in the document, otherwise your change won't have any effect.

Edit: inside the box partial itself, you can access the page using box.page

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by elisandroesp
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants