Skip Navigation

[Résolu] Front end login with blocks

This support ticket is created Il y a 1 année et 11 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Ce sujet contient 4 réponses, a 3 voix.

Dernière mise à jour par erikd-6 Il y a 1 année et 11 mois.

Assisté par: Minesh.

Auteur
Publications
#2514675

Tell us what you are trying to do?
I am trying to build a front-end login with Toolset Blocks.

Is there any documentation that you are following?
I know how to build front-end login with the now legacy Toolset Views shortcodes but I am not sure how to use the [wpv-...] shortcodes in blocks.

Is there a similar example that we can see?
This is a staging site but you certainly can imagine what I'm talking about.

What is the link to your site?
See previous point.

Recently I had to say goodbye to my former habit of building sites with Toolset Layouts and Views. Since the PHP update to version 8 those 'legacy' plugins seem to be no longer compatible with the PHP environment. Since I also see some advantages I decided to turn to a new site building method based on Astra Pro and Toolset Blocks.

In the age before Gutenberg I would build my front-end login page as follows:

[wpv-conditional if="('[wpv-current-user info='logged_in']' ne 'true')"]
[wpv-login-form redirect_url="url to some page"]
Forgot password?
[/wpv-conditional]
[wpv-conditional if="('[wpv-current-user info='logged_in']' eq 'true')"]
Hello [wpv-user field="user_firstname"], You are already logged in!
[/wpv-conditional]

The lost password page had the following structure:

[wpv-conditional if="('[wpv-current-user info='logged_in']' ne 'true')"]
Fill in your username or email address and click the button Receive new p[assword.
You will receive an email with instructions how to set a new password.
[wpv-forgot-password-form redirect_url="url to login page"]
[/wpv-conditional]
[wpv-conditional if="('[wpv-current-user info='logged_in']' eq 'true')"]
In order to make a new password you have to logout first.
<div class="button">[wpv-logout-link redirect_url="link to lost password page"]Logout[/wpv-logout-link]</div>
[/wpv-conditional]

As you can see we are using the following shortcodes:

[wpv-conditional]
[wpv-login form] with redirect option
[wpv-user-field="user_firstname"]
[wpv-forgot-password-form] with redirect option
[wpv-logout-link] with redirect option

This system was very versatile and easy to set up a user friendly front-end login/logout and password recover functionality with full control over the redirections after the various stages.

What I am looking for now is the same functionality in the "new" Toolset Blocks era.

My specific questions are:
1. Can I build front-end login/logout and password recover functions with redirection with ths same functionality as above described?
2. Are the [wpv] shortcodes still applicable in blocks, and, if yes:
a. How?
b. Will they stay applicable in the furure?

#2515289

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Hi Erik

The shortcodes continue to work and can still be used, and—in fact—are the only way to implement the login workflow, whether using the block editor or not.

In the Block editor there is a Shortcode block (a core WP block) where you can add shortcodes, and if I recall correctly I think they also work in a Custom HTML block, which is very much like using a markup editor with shortcodes like you are used to.

What would be missing is the button to insert (and generate) the shortcodes.

You can use the Fields and Text block in that case: switch to HTML mode and the button with the Toolset icon is the equivalent of the old "Fields and Views" button to insert shortcodes.

Except note that it is currently not working with the latest update of WordPress, but we are releasing a Blocks update imminently (possibly later today).

Also, in the admin toolbar there is a Toolset shortcodes link which you can use to generate shortcodes and then paste them into an editor (such as the Custom HTML block) that doesn't have a Field and Views button. (If it is missing, check Toolset > Settings.)

Shortcodes will continue to be supported, under the hood it's how much of Toolset is built.

#2515591

Hi Nigel,

That's a relief. Thanks for explaining this. I will keep an eye open for the update.

I also noticed that i can keep editing views and content templates in their classic editor environments, which I find much more convenient, clear and precise than than tho block editor. It is a setting in the Toolset settings.

Could you confirm that this possibility will remain in place in future versions?

I mean specifically the settings on the General tab: Editing experience, Editor to use for Content Templates and Editor to use for WordPress Archives, which allow for using the classic editor.

#2515917

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Could you confirm that this possibility will remain in place in future versions?
I mean specifically the settings on the General tab: Editing experience, Editor to use for Content Templates and Editor to use for WordPress Archives, which allow for using the classic editor.
==>
Yes - that feature is added keeping in mind that users who wants to work with blocks and use blocks and who prefer to keep using classic views - they can continue with that. So to answer your question is yes, those settings will be there.

#2516541

That is good to know.
My issue is resolved now. Thank you!