Skip to Content Skip to Menu

Userlist - combining multiple columns

  • mduda
  • mduda
  • OFFLINE
  • Posts: 14
  • Thanks: 2
  • Karma: 0
7 years 3 months ago #295693 by mduda
Replied by mduda on topic Userlist - combining multiple columns
Hi Kyle,

I appreciate your patience on this!

I have created a custom html field for teachers (combining all teachers), and another for students (combing all students).
Below is a screenshot of the teacher custom field.



Using Substitutions, I'm not able to search or sort on these fields. The only option I have to sort by teacher, is to do a search with all four teacher fields (teacher1, teacher2, teacher3, and teacher4).

So when the user wants to search for the teacher "smith" for example, they will have to input "smith" into four different fields.

It's just not user friendly. Is there any other option? Example of what comprofiler fields look like in the table.



Thanks.
Attachments:

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8280
  • Karma: 1443
7 years 3 months ago #295705 by krileon
Replied by krileon on topic Userlist - combining multiple columns
You can not search or sort Custom HTML fields. They aren't stored in the database for the users rows and are calculated on display. Based off the CSV output you've provided you will not be able to do that with a userlist without Sally having 4 accounts. Your best option is to consolidate it into a single Custom HTML field as follows.

Code:
<table class="table table-responsive"> <thead> <tr> <th>Student</th> <th>Teacher</th> </tr> </thead> <tbody> [cb:if cb_student1!=""]<tr><td>[cb_student1]</td><td>[cb_student1teacher]</td></tr>[/cb:if] [cb:if cb_student2!=""]<tr><td>[cb_student2]</td><td>[cb_student2teacher]</td></tr>[/cb:if] [cb:if cb_student3!=""]<tr><td>[cb_student3]</td><td>[cb_student3teacher]</td></tr>[/cb:if] [cb:if cb_student4!=""]<tr><td>[cb_student4]</td><td>[cb_student4teacher]</td></tr>[/cb:if] </tbody> </table>

Next be sure each student and teacher field is searchable so you can search on the individual teacher or student fields.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum