Tell us what you are trying to do?
I will have 3 different user role on website (projektant, konstrktor, graditelj). Everyone can registred, on registration form I need dropdown manu where guest choose thair user role. Every role have Services,Location of work and Type of work.
For now I create Post Type PROJEKTANT and all the sam I need for user role projektat (list of all, single profile, edit thair profil).
url: hidden link here you can see that i have create filter by taxonomies, clikc on name open profil with data.
Can I somehow "connect" post type with user role?
Is there any documentation that you are following?
I watch you documentatio but don't work for me..
What is the link to your site?
hidden link
Hi,
Welcome to Toolset support and I'd be happy to assist.
The custom post types can't be directly connected to the users or users roles, however, you can use the Toolset Access plugin to control which user roles can add, edit or view a particular custom post type:
https://toolset.com/lesson-placement/lesson-placements-1621543-1655635/
For all 3 roles ( i.e. projektant, konstrktor, graditelj ) you can add 3 different custom post types, and then through the Access post type control, you can adjust the privileges for these post types for each user roles.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Hi Waqar,
How can I create for every user profil (I put custom field in profil and create view of user), I need fiter tham by like I create filter here: hidden link with filter by taxonomies. And when I click on one of them I see profil of that user.
And every user can edit thair profil (change image, bio info..). I need create user profil to look like that hidden link
I need to create 3 user profiles, each has its own profile, I will have 3 subpages where each will have a list of one profile role and a list of those profiles with a filter. Each user profile must select certain properties (taxonomies ) and the profiles will be filtered according to them.
regards,
Marko
Hi Marko,
Thank you for sharing further details.
The search filters can be used with the list of posts, but not with the list of users.
For this particular requirement, I'll suggest a different structure that will make use of some additional custom post types:
( and you probably won't need the separate user roles )
1. You can register 3 new custom post types:
- projektant profile
- konstrktor profile
- graditelj profile
2. At the time of registration, each user will use a common user form, which will create a user collecting only basic information, like name, email, password etc.
3. After the user has logged in, he/she will see 3 different forms (one for each of those 3 new post types). This will allow them to create a detailed profile as projektant, konstrktor or graditelj. The user who will create a new post in any of these post types will be set as that post's author, which will act as a connection or link between the user and his/her profile.
As a result, the user's basic information will be stored as a WordPress user, but the detailed professional information will be saved in the respective post type as the profile.
Just as with other post types, you'll be able to create post views for these post types to create a list with the custom search:
https://toolset.com/lesson-placement/lesson-placements-1621261-1622283/
regards,
Waqar
Hi Waqar,
can you login into my site and fix some things for me?
I create user
I create custom post type Projektanti
I create structure for post type Projektanti
I create list view of custom post type Projektanti with filter
I create my accoutn (moj profil) page with login and registration.
I need to set options that you are suggest , that one user can have and edit only one post type PROJEKTANTI so that look like his profile.
Thanks for the update.
Have you also added a front-end Post form so that a user can create a PROJEKTANTI post?
( relevant guide: https://toolset.com/lesson-placement/lesson-placements-1621521-1612071/ )
Once you have created this form and the page that a user sees, after logging in, you're welcome to share that page's link and temporary admin login details, so that I can guide you with the next steps for restricting the form to only one post submission, for each user.
Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.
Thank you for sharing these details.
To make sure each user can create only 1 "Projektanti" using the "Form for Projektanti", you can follow these steps:
1. First, you'll need a custom shortcode, which can give you the count of posts from a specific post where the current user is the author.
add_shortcode('current_user_post_count', 'current_user_post_count_fn');
function current_user_post_count_fn( $atts ) {
$a = shortcode_atts( array(
'type' => ''
), $atts );
$user_post_count = count( get_posts( array(
'post_type' => $a['type'],
'author' => get_current_user_id(),
) ) );
return $user_post_count;
}
The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through the active theme's "functions.php" file.
When you'll use this shortcode in your content, it will give you the count/number of 'projektant' posts, the currently logged-in user has added as the post author.
[current_user_post_count type='projektant']
2. Next, please add "current_user_post_count" in the "Third-party shortcode arguments" section, at WP Admin -> Toolset -> Settings -> Front-end Content.
3. In your page "Moj profil", you can insert your form inside a conditional check, so that the form is only shown if the count/number of 'projektant' posts by the currently logged-in user is 0, which means that he/she hasn't created a 'projektant' profile yet.
( ref: https://toolset.com/documentation/legacy-features/views-plugin/using-shortcodes-in-conditions/ )
[wpv-conditional if=" ( ( '[current_user_post_count type='projektant']' eq '0' ) ) " ]
[cred_form form="form-for-projektanti"]
[/wpv-conditional]
I hope this helps and please let me know if any point or step is not clear.
Hi,
it's don't work for me, pleas login and see where I made mistake.
I have need to have "button" with title See profil and whan user on page My account(Moj profil) click on that button, he will see his "profil" (post).
And is it possible to see in form for edit post, last inserted data?
regards,
Waqar
I forgot to ass..how can I go back edit page structure with visual composer not a gutenberg? I have created Template (Izgled profila projektanta) and I wanna edit that page in composer not in block..
thx
regards,
Marko
Thanks for writing back.
I checked the page "Moj profil" and noticed that the shortcode for the form was added, without any conditional check, as suggested in step 3 of my last reply:
{!{cred_form form='form-for-projektanti'}!}
I've updated it to include the conditional check like this:
{!{wpv-conditional if=" ( ( '[current_user_post_count type='projektant']' eq '0' ) ) " }!}
{!{cred_form form='form-for-projektanti'}!}
{!{/wpv-conditional}!}
You'll see that the form will now show, only to those users who haven't created a 'projektant' profile/post before.
Note: You'll find a link to switch from the Blocks editor, at the bottom of the right settings pane, as shown in this screenshot.
hidden link
Once you've switched to the classic editor, you'll see that the button to edit the content template through visual composer will become available too.
HI,
Thanks for helping. I have more staff to do.
1. How can user edit thair post ("porfil")?
2. Is their a option to have to see all time form and that form have default value that user are input first time
3. How can I create lithebox gallery? I have create and user can update multiimages, I need creade grid 3x3 and on click opet large image.
4. Link on MY PROFIL PAGE for see/edit post ("profil")?
best regards,
Marko
Thanks for the update and glad that the form for the profile creation is working now.
I've split a new ticket for your questions about the profile edit form and will follow up on it separately.
( ref: https://toolset.com/forums/topic/split-how-to-edit-user-profile/ )
You're welcome to mark this ticket as resolved and start a new one for each new question or concern.
My issue is resolved now. Thank you!