Last active
August 24, 2017 19:27
-
-
Save wizhippo/14c3d7c6b044c78135c4d1589edb2a35 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ ez_render_field( global_layout_object, 'page' ) }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? php | |
/** | |
* Displays the extra info section that contains the global layout | |
* | |
* @return Response | |
*/ | |
public function viewExtraInfoAction() | |
{ | |
$query = new Query( | |
[ | |
'query' => new Criterion\LogicalAnd( | |
[ | |
new Criterion\ContentTypeIdentifier(['global_layout']), | |
new Criterion\Subtree($this->getRootLocation()->pathString), | |
new Criterion\Visibility(Criterion\Visibility::VISIBLE), | |
new Criterion\LanguageCode( | |
$this->getConfigResolver()->getParameter('languages') | |
) | |
] | |
), | |
'limit' => 1, | |
'performCount' => false | |
] | |
); | |
$searchHits = $this->getRepository()->getSearchService()->findContent($query)->searchHits; | |
$globalLayoutObject = $searchHits[0]->valueObject; | |
return $this->render( | |
'@AppBundle/parts/extra_info.html.twig', | |
['global_layout_object' => $globalLayoutObject] | |
) | |
->setSharedMaxAge(600) | |
->setVary('X-User-Hash'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment