Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hello again dear couch friends,

a simple question this time. :)

We have a relations field in a frontend databound form that needs to be filtered by folder e.g. the logged in user only sees his company's projects.

How can I achieve this? (Sorry, couldnt find anything on the forum but im pretty sure this could have been asked before).

Cheers
Laduma
Normally it all depends on the way you defined editables. Generally, filtering is used with custom_field parameter of <cms:pages />. Current logged user has k_user_id. You can consult this topic for samples - Simple queries - viewtopic.php?f=5&t=8581&p=16352
Thanks for your reply!

What i need is something like this:
(Its a relation field by definition. The correct values with key/value pair are display in the dropdown, but it doesnt save the project.)

Code: Select all
<div class="form-group">
    <b>Project</b>:<br />
    <cms:input
       name='project'
       type='dropdown'
       class='form-control'
       opt_values="<cms:pages masterpage='projects.php' custom_field="project_owner='CompanyName'"><cms:show k_page_title />=<cms:show k_page_id /> | </cms:pages>" />
</div>


Should I name it different? Something with the ID? (The name is correct - "project")...

EDIT: No worries i got it to work with the db_persist tag..! Thanks guys!

Cheers!
Laduma
3 posts Page 1 of 1