I want to modify the Oauth login template (/styles/my_style/template/login_body_oauth.html) of a phpBB(ver. 3.1.8) theme style to something like this:
<div class="content">
<!-- BEGIN oauth -->
<dl>
<dt> </dt>
<dd><a href="{oauth.REDIRECT_URL}">
<!-- PHP -->
if({oauth.SERVICE_NAME}=='Facebook')
echo '<img src="fb.png">';
elseif({oauth.SERVICE_NAME}=='Google')
echo '<img src="google.png">';
<!-- ENDPHP -->
</a></dd>
</dl>
<!-- END oauth -->
</div>
which results: Catchable fatal error: Argument 1 passed to phpbb\template\twig\node\php::__construct() must be an instance of Twig_Node_Text, instance of Twig_Node given, called in forum/4_3_1/phpbb/template/twig/tokenparser/php.php on line 35 and defined in forum/4_3_1/phpbb/template/twig/node/php.php on line 21
However, I have checked that the oauth values are stored as arrays in the php array $context['loops']['oauth']
. So, a foreach
looping through $context['loops']['oauth']
will give the desired result.
What is the correct method? or any other phpBB specific alternative?
Done:
<div class="content">
<!-- BEGIN oauth -->
<dl>
<dt> </dt>
<dd><a href="{oauth.REDIRECT_URL}" class="social_login" title="Login with {oauth.SERVICE_NAME}">
<!-- IF oauth.SERVICE_NAME=='Facebook' --><img src="{T_THEME_PATH}/images/login_fb.gif" width="238" height="43" alt="facebook">
<!-- ELSEIF oauth.SERVICE_NAME=='Google' --><img src="{T_THEME_PATH}/images/login_google.gif" width="238" height="43" alt="google">
<!-- ELSE -->{oauth.SERVICE_NAME}
<!-- ENDIF -->
</a></dd>
</dl>
<!-- END oauth -->
</div>