Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi Everyone. I hope your all well.

Just wondering, I'm currently creating my submission form. However i want certain forms to only be posted by user group or how i've setup the user group.I've created a custom editable of account_type Now this is a dropdown so i have a group called Traders. So when they try and add in a product onto our website i only want that custom field to be able to see, submit the form.

Thank You very much in advance.
Simon
Anyone that would like to filter out what can be posted by what members.

Within my registration form i'm using an account type.

Code: Select all
<cms:editable 
  name="account_type"
  label="Account type"
  desc="Select one from these"
  opt_values=' | Basic | Pro | Traders | Pro Traders | '
  type='dropdown'
/>


You can set whatever groups you wish however ensure that a basic account is set otherwise when they register it'll register as the first value you set.

In the submission databound forms that you wish to filter the user group privileges here is how. I have set the traders as my privilege.

Code: Select all
<cms:if account_type='Traders' >
Hi, You can post as a trader
<cms:else />
Sorry, your not a trader
</cms:if>


When doing this your submission form must hold the bellow code within the template otherwise it'll not fetch the custom field.

Code: Select all
<cms:pages masterpage=k_member_template id=k_member_id></cms:pages>


Place bellow this code to ensure it correctly fetches the details

Code: Select all
<cms:template title="iStore Submission" hidden='1' />
<cms:member_check_login />
    <cms:if k_member_logged_out >
        <cms:redirect "<cms:member_login_link />
" />
    </cms:if>


And end the </cms:pages> after the last </cms:if>
Hi Simon,

You know everything that is required to code what you mentioned.
One way could be as follows -
Code: Select all
<cms:member_check_login />

<cms:if k_member_logged_out >
    <cms:redirect "<cms:member_login_link />" />
</cms:if>

<cms:pages masterpage=k_member_template id=k_member_id>
    <cms:if account_type='Traders' >
        Hi, You can post as a trader
       
        <!-- show form here if member is in 'traders' group -->
        <cms:form ..
        ..
        </cms:form>
       
    <cms:else />
        Sorry, your not a trader
    </cms:if>
</cms:pages>
3 posts Page 1 of 1
cron