jorenvanhee / craft-template-guard

Password protect any page or entry in Craft CMS.
Other
5 stars 0 forks source link

Custom Template not working #15

Closed markusgabriel closed 11 months ago

markusgabriel commented 1 year ago

When I make a copy of the login template and reference it in the settings to make some changes, I get an error because '_includes/forms' can't be found. Could you please explain how exactly I can make my own login template?

jorenvanhee commented 1 year ago

For making your own template, you can only use the contents of the body block and this line {% set error = craft.app.session.getFlash('error') %}. The used layout and form includes are only accessible to the plugin, not if you're using a custom template. I will make this clearer in the docs, I get the confusion.

markusgabriel commented 1 year ago

Thank you for your response. I still get the error 'Variable "forms" does not exist.' because of the template part:

{{ forms.passwordField({ id: 'password', name: 'password', placeholder: 'Password'|t('template-guard'), autocomplete: 'current-password', inputAttributes: { aria: { label: 'Password'|t('template-guard'), required: 'true', }, }, }) }}

Do I have to declare my own password field?