Forum for discussing general topics related to Couch.
6 posts Page 1 of 1
Hello,
for a personal project i need a user list mail for backoffice updated with the list of members but only superadmin update the template to insert new user in the cms type checkbox. Is possible to add admin backoffice account for this ?
Hi,

Please post more details of the use-case.

Instead of hard-coding the values of the checkboxes in the template, it'd be better to generate the checkboxes dynamically using data stored elsewhere e.g. take a look at this - viewtopic.php?f=8&t=7998#p13629

How do you eventually use the values from the checkboxes? Please let me know the details.
Thanks.
Thank for your reply KK,

i use the members script,the code in my page for return my back-office checkbox is :

Code: Select all
<cms:editable
  name="user_perm"
  label="Permission"
  opt_values="<cms:embed 'user_list.html' />"
  group="perm_bien"
  type='checkbox'
/>


and the snippet for user_list.html is :
Code: Select all
<cms:pages masterpage=k_member_template>
<cms:show member_email/> |
</cms:pages>
Thanks.
So, it seems you are already using a dynamic method of populating the checkboxes.

Going by your code, all the 'members' (i.e. pages fetched from the member's template) should automatically show up as 'permissions' checkboxes. There is no super-admin or admin involved in the process of populating the checkboxes.

As far as selecting from those checkboxes, anyone with access to the admin-panel can do that. Since an admin can do that, I apologize but I couldn't understand what you are looking for. As far as I can see, the admin is already authorized to make the selection.

If he wishes to add some more 'checkboxes', he should go into the 'members' template and add a page there - it will automatically appear as a checkbox.

As I said, I am still unable to completely comprehend the use-case. If my reply does not help, please explain in more detail the exact problem you are trying to solve. Thanks.
The problem is if a new user is register to the site my checkbox don't update the list with this user if i don't go to the page with superadmin user.
My apologies .. I should have noticed that from your code.

You can find the solution in this post - viewtopic.php?p=2483#p2483

Applying that to your code, your editable region's definition would become as follows (make sure to visit the modified template as super-admin) -
Code: Select all
<cms:editable
  name="user_perm"
  label="Permission"
  opt_values='user_list.html'
  dynamic='opt_values'
  group="perm_bien"
  type='checkbox'
/>

Hope it helps.
6 posts Page 1 of 1