Page 1 of 1

FEU 3.2 Changes to loginform custom template is ignored

Posted: Wed Mar 04, 2020 8:45 pm
by webform
I've copied the FEU login form "/modules/FrontEndUsers/templates/orig_loginform.tpl" to "/assets/module_custom/FrontEndUsers/templates" and placed {cms_module_hint module=FrontEndUsers logintemplate="my_loginform.tpl"} in the logic field of my login page.

But it seems the section with redirect or final message in the custom template is ignored and instead uses the "orig_loginform.tpl" template.
So any styling or redirect i've done to this section:

Code: Select all

{elseif !empty($requested_url)}
         {* we have logged in... but we originally requested a different URL.  We can go back there *}
	 {redirect_url to=$requested_url}
     {else}
         {* After login, we display a final message *}
         {* note: you could also redirect somewhere here:  see the redirect_page, redirect_url plugin, cms_selflink, cms_action_url and module_action_url plugins *}
         <div class="alert alert-info">{$final_msg}</div>
     {/if}
in my custom template is ignored and the module default template is used instead.
The form itself is using my custom template, so cms_module_hint is calling my custom login form.

Is it a bug or am i doing something wrong?

Code: Select all

Cms Version: 2.2.13
CGExtensions: 1.65.1
FrontEndUsers: 3.2

Re: FEU 3.2 Changes to loginform custom template is ignored

Posted: Thu Mar 05, 2020 7:48 pm
by webform
OK! I think i've figured something out;

You can't use "my_loginform.tpl" in a module_custom template, you have to use the original file name for the template "orig_loginform.tpl" or else the template is ignored.

I couldn't understand why any of my custom template edits didn't take. Then i tried to rename my templates files to FEU's templates original file names and now it's working.

Curious enough though, there is no problem using "my_custom_logoutform.tpl" for the logout form, but i have to use the original file names for the login form and post logout!

Re: FEU 3.2 Changes to loginform custom template is ignored

Posted: Fri Mar 06, 2020 12:44 am
by DIGI3
I've found the same, it's rather inconsistent of what works with module_hints or other methods of choosing alternate templates. You might wish to file a bug report for the module, I have a few I need to test on a clean install first and will do the same.

Re: FEU 3.2 Changes to loginform custom template is ignored

Posted: Fri Mar 06, 2020 11:56 am
by velden
Are you saying you create your custom NAMED templates and put them in the module_custom folder?

I'd expect the module_custom folder to be exclusively used for overriding (admin) templates which come by default with the module. Not for putting there your alternative templates too.

Re: FEU 3.2 Changes to loginform custom template is ignored

Posted: Sun Mar 08, 2020 8:43 am
by webform
Yes, that make most sense as that is the usual way to use module_custom folder.

But i got confused (properly not enough sleep) when FEU Help states:
There are numerous locations where you can locate your custom templates:
In the /assets/module_custom/FrontEndUsers/templates directory
You may need to create this directory structure, as it does not exist by default. Files in the module_custom directory will not be overwritten when the module is upgraded.

Files in this directory MUST end with a.tpl extension, and are accessed by just specifying the filename. i.e.: my_login_template.tpl

Re: FEU 3.2 Changes to loginform custom template is ignored

Posted: Tue May 19, 2020 11:03 am
by reinhardmohr
Additional bug in module help:
Hi,
thanks for this post – it helped me after hours of struggling to find a solution (and thanks for making modules like FEU!).
Around the problem described here I found another minor problem that made it more difficult for me to find the solution:
Module help for FEU 3.2.2 describes where the custom templates must be stored:
You should NEVER modify these source files. These files can be overwritten when the module is upgraded. Always copy them to a new location.
There are numerous locations where you can locate your custom templates:
In the /assets/templates directory.
Copy the factory template to a desired filename in /assets/templates. Give the new file a .tpl extension.
Files in this directory are accessed by specifying the cms_file resource. i.e: cms_file:my_login_template.tpl
But at least for me and CMSms 2.2.14 this does not work. The prefix cms_file: seems to be wrong. For me only file: does work. E.g.:

Code: Select all

{FrontEndUsers logintemplate="file:fampa_loginform.tpl" logouttemplate="file:fampa_logoutform.tpl"}
I hope this may help someone who tries to get this otherwise great module to work properly.
Thanks for CMSMS, the modules and the great support here

Reinhard