I want to assign a variable within an embed file that has a php conditional in it.
The code for the php conditional, which is stored within template: include/header
<?php
if($user_in_group) {
?>{assign_variable:access_to_page="YES"}<?php
}
?>Then the template it is embedded within is like
{embed="include/header"}
{if "{embed:access_to_page}" == "YES"}<h1>has access to page</h1>{/if}
{embed="include/footer"}I also tried different variations of the EE conditional
{if "{access_to_page}" == "YES"}<h1>has access to page</h1>{/if}{if {access_to_page} == "YES"}<h1>has access to page</h1>{/if}{if access_to_page == "YES"}<h1>has access to page</h1>{/if}None of those worked.
I imagine it is not possible doing it this way. If it is, I’d love to find out how.
I would like to use the native EE conditional in this situation.