Questions regarding roles

I’m following up on the February 2024 thread ( https://community.hivepress.io/t/can-you-create-a-profile-for-candidates-in-jobhive/9770/13 ) with 4 questions. I’m currently creating a job board in French-speaking Belgium. I’ve installed Jobhive, HivePress, and all the free and paid extensions.

  1. When you click the ‘Post a job’ button, if the user hasn’t yet defined his profile, he is taken to a registration form. However, you mentioned in that thread that a user’s profile is only defined as a vendor once he has posted a listing. This profile creation form mixes fields related to candidates and employers. This doesn’t seem UX-friendly to me. If candidates are faced with fields related to a company (logo, number of employees, website, …), they’ll be confused by not knowing what to fill in and will feel like they’re in the wrong place or on the wrong page, and will probably leave the site. Conversely, if vendors have to fill in fields for the candidate (resume, qualifications, etc.), they’ll be confused. It seems to me that it would be better to define from the outset whether one is registering as an employer or as a candidate, and then be directed to a separate form with two buttons in the menu.

  2. It also seems preferable to separate the two steps: creating a profile and posting a job listing.

  3. Is it possible to create a personal dashboard for both candidates and employers so they can manage their accounts, job postings, favorites, and statistics?

  4. It would also be useful for a vendor to be able to view the profile of a candidate who has sent a message or a request but has not attached a resume with it.

Hi @Pierre,

User Attributes are fields that apply to all registered users on your site. These are basic profile information that anyone can fill in during registration.

Vendor Attributes are specialized fields that only vendors (employers/companies) need to complete. These are managed in HivePress > Vendors > Attributes and are specifically for vendors who post listings (jobs).

The best approach is to use direct vendor registration:

  • Enable direct registration in HivePress > Settings > Vendors > Registration
  • Add at least one required vendor attribute in HivePress > Vendors > Attributes (e.g., “Company Name”)
  • Create two separate menu links:
    /register-vendor for employers (this will show the vendor profile form with company-specific fields)

Standard registration for candidates (they register without vendor fields)

  • This way, employers see only company-related fields, and candidates see only user-related fields.

Much of the dashboard experience you describe is already built-in to HivePress by default. However, for some menu items to appear in the user’s menu, they’ll need to have performed/received an appropriate action beforehand.

For example, to see the ‘Favourites’ menu item, user’s need to favourite a listing first - then, the menu item will appear.

I hope this helps!

Cheers,
Chris :victory_hand:

1 Like

HI,

  1. The “Post a Job” button is intended for vendors (companies), as they are the ones who create and manage job listings. Regular users typically don’t need to use this feature, so they won’t be required to fill in vendor-related information. Vendor-specific details are collected during the Complete Profile step after registration.

If you’d like to clearly separate the registration flows for users and vendors, you can enable direct vendor registration: How to add a vendor registration form - HivePress Help Center
You can also create user and vendor attributes (as Chris mentioned), so different fields are shown depending on the selected role.

  1. Enabling direct vendor registration (as mentioned above) should help address this request.

  2. Both users and vendors have profiles with sections such as Messages and Favorites. Vendors additionally have access to Listings. These sections can be accessed via the profile dropdown menu under the user’s name.

  3. If you enable the Display profiles on the front-end option in HivePress > Settings > Users, this will make profiles clickable in messages. It will also display user profiles in Requests.

Hope I helped with your request.

Please let me know if you need further assistance.

Thanks ChrisB for the idea of two links, specifically …/register-vendor, which works well. However, when registering as a regular user and logging in for the first time, you arrive at the jobs listing page (…/account/listings). This is fine for candidates. One might think this is the candidate dashboard. There are two menu links in the margin: ‘Jobs’ (active page) and ‘Settings’. Two issues on this page: 1) the ‘Settings’ link leads to the details form for employers (…/account/settings) ; 2) the button in the menu is the “Add a job offer” button, which is only relevant for employers; this button should be hidden from candidates on this menu. It seems there’s still this account mix-up. However, on the second login, you no longer arrive at the job offers page but directly at the …/account/settings page, which this time offers the form for users but without the tag ‘Jobs’ in the margin.

Hi @Pierre,

Glad to hear you’ve made some progress! Some of what you describe is actually default/intended behaviour in HivePress. Typically, when a user joins your site they don’t become a Vendor until they have at least one published listing. This means that Users are able to place an order/book a listing whilst using the same account which they’ve created listings with.

The /account/settings page is supposed to be visible for both regular users and Vendors as this is where they can manage their account details, display picture, update their password, etc.

As described above, traditionally everyone registers as a User first, and if desired, they can become a Vendor. However, because you’re using the direct Vendor registration link to help seperate user account types from the get-go, the most reliable approach would likely be to use a PHP snippet with the logic that targets specific roles:

add_action( 'wp_head', function() {
    $user = wp_get_current_user();
    $roles = (array) $user->roles;
    
    // Hide button for subscribers
    if ( in_array( 'subscriber', $roles ) ) {
        echo '<style>
            .hp-menu--site-header .hp-menu__item--listing-submit {
                display: none !important;
            }
        </style>';
    }
} );

This way, the /submit-listing form remains accessible via direct URL, but the button is hidden from regular users in the header menu.

I believe it’s also possible to alter/set which page users land on after registering or logging in. However, if you have enabled email address verification, it might not work as intended.

Nevertheless, the following PHP snippet should allow you to set the page in which users are directed to after registration.

add_filter(
 'hivepress/v1/forms/user_register',
 function($form){
  $form['redirect'] = 'your-vendor-redirect-url-here';
  return $form;
 },
 1000
);

Again, I haven’t tested this, and in full transparency, AI has suggested the snippets, so please take them with a pinch of salt. Regardless, @kseniia will likely add to/correct this tomorrow.

I hope this helps for now!

Cheers,
Chris :victory_hand:

1 Like

Hi,

Thanks @ChrisB!

Regarding hiding the button from regular users, please use the following snippet: Hide the Add Listing button from regular users #hivepress #listings · GitHub.

There is no defined page when the user registers via the Sign In button. After registration, the user is redirected to the page they were on before deciding to register.

Let me know if you need further assistance.

1 Like