overwrite phpbb template file

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
aleba89
Registered User
Posts: 4
Joined: Thu Nov 30, 2017 8:16 am

overwrite phpbb template file

Post by aleba89 »

Hi,
I'm developing an extension that implement single sign on with a Solidus ecommerce. I need change template file where there is a login button for change link (the link of login point to page of single sign on). I read in documentation that if I put a file with the same name of a phpbb template, this file overwrite the orignal file but doen't works! With event I can only put other code after or before the event and so I can't change login url.
I want put the file in styles/all/template.
Can you help me?

Thanks
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: overwrite phpbb template file

Post by david63 »

It may be possible in an event to replace the url but without some indication of the code that you are working with it is somewhat difficult to help.
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
aleba89
Registered User
Posts: 4
Joined: Thu Nov 30, 2017 8:16 am

Re: overwrite phpbb template file

Post by aleba89 »

Code: Select all

<li><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x" role="menuitem">
<i class="icon fa-power-off fa-fw" aria-hidden="true"></i><span>{L_LOGIN_LOGOUT}</span>
</a>
</li>
I want to change this url for example.
My question is: there is a way for overwrite all one template?
One idea is hide old navabar with css display none and use event to insert new navbar. this is awful solutions!!
thanks
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: overwrite phpbb template file

Post by david63 »

You should be able to use the core.page_header_after event to re-write the U_LOGIN_LOGOUT template variable to whatever it is that you want it to be.
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
aleba89
Registered User
Posts: 4
Joined: Thu Nov 30, 2017 8:16 am

Re: overwrite phpbb template file

Post by aleba89 »

Ok, very thanks.
I've another question:
I've to put template auth_provider_myextension.html in adm/style. I've created directory adm and style in my extension directory and I put this file there, but phpbb search template in /adm/style/ and so not found. I want put this file in my extension directory..there is a way?

This file is included in acp_board.html with instruction:

Code: Select all

<!-- BEGIN auth_tpl -->
		<!-- INCLUDE {auth_tpl.TEMPLATE_FILE} -->
	<!-- END auth_tpl -->
in metthod get_acp_template in my authprovider class i've defined a template path but doesn't work.

Code: Select all

    public function get_acp_template($new_config)
    {

        return ;
            array(
            'TEMPLATE_FILE'	=> $this->phpbb_root_path . 'ext/adm/style/auth_provider_solidussso.html',
            'TEMPLATE_VARS'	=> array(
                'SECRET_KEY_SOLIDUSSSSO' => $new_config['secret_key_solidussso'],
                'LOGIN_URL_SOLIDUS'		=> $new_config['login_url_solidus'],
                'LOGOUT_URL_SOLIDUS'		=> $new_config['logout_url_solidus']

            ),
       );
    }

Thanks
aleba89
Registered User
Posts: 4
Joined: Thu Nov 30, 2017 8:16 am

Re: overwrite phpbb template file

Post by aleba89 »

Can you help me?
thanks
Post Reply

Return to “Extension Writers Discussion”