Overriding login/register templates not possible in theme. #3401

Closed
Kaik opened this Issue Jan 22, 2017 · 4 comments

Projects

None yet

2 participants

@Kaik
Contributor
Kaik commented Jan 22, 2017 edited
Q A
Zikula Version 1.4.5
PHP Version 5.x

Problem:

Cannot override login/register template inside a theme.

Reson

Because event handler responsible for overriding the template that is called using namespace is not taking account of ZikulaUserModule and ZikulaZAuthModule work in collaboration while displaying mentioned pages.

Using template call other that FQN works.

@Kaik Kaik changed the title from Template override not working properly. to Template override is not working properly. Jan 22, 2017
@Kaik Kaik changed the title from Template override is not working properly. to Overriding login/register templates not possible in theme. Jan 22, 2017
@craigh
Member
craigh commented Jan 24, 2017

I'm sorry, but I cannot understand this ticket. You need to use sentences and punctuation and organize your thoughts. Please rephrase the original ticket and explain more specifically.

@craigh craigh added this to the 1.4.6 milestone Jan 24, 2017
@Kaik
Contributor
Kaik commented Jan 24, 2017

Please take a look now.

@craigh
Member
craigh commented Jan 25, 2017 edited

rephrasing:

using ZikulaZAuthModule:Authentication:UnameLogin.html.twig instead of 'namespaced' template naming (e.g. @ZikulaZAuthModule/Authentication/UnameLogin.html.twig) in an AuthenticationMethod class (example) will solve this problem.

This is because namespaced template overrides are handled by this listener and it assumes that the template belongs to the module that is calling it - e.g. it assumes this path MySpecialTheme/Resources/ZikulaUsersModule/views/Authentication/UnameLogin.html.twig instead of MySpecialTheme/Resources/ZikulaZAuthModule/views/Authentication/UnameLogin.html.twig

@craigh craigh self-assigned this Jan 25, 2017
@craigh
Member
craigh commented Jan 26, 2017

@Kaik please submit a PR with the fix you recommended.

@Kaik Kaik added a commit to Kaik/core that referenced this issue Jan 26, 2017
@Kaik Kaik Change the way templates are called fixing #3401 2840c60
@craigh craigh closed this Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment