- Posts: 13
- Thank you received: 0
How to add custom fields to search query frontend
- Helene Larocque
- Topic Author
- Offline
- New Member
-
Less
More
9 years 1 month ago #77155
by Helene Larocque
How to add custom fields to search query frontend was created by Helene Larocque
Hi !
I noticed that the search field on the frontend member's list only search through "core fields" excluding custom fields. Is there a way we can include custom field in the search query?
I noticed that the search field on the frontend member's list only search through "core fields" excluding custom fields. Is there a way we can include custom field in the search query?
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
9 years 1 month ago #77182
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic How to add custom fields to search query frontend
Hi Helene
Unfortunately, we could not search for data from extra custom fields you created.
Tuan
Unfortunately, we could not search for data from extra custom fields you created.
Tuan
Please Log in or Create an account to join the conversation.
- Helene Larocque
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 13
- Thank you received: 0
9 years 1 month ago #77306
by Helene Larocque
Replied by Helene Larocque on topic How to add custom fields to search query frontend
Sad. I tried to use the "comment" field to put some useful information so the user may be found more easily but it doesn't seem to be part of the search query neither.
This has a important impact on the way people search for members because they do not always know the name but they may want to look for skills or else. Is it something that will be part of a next release ?
This has a important impact on the way people search for members because they do not always know the name but they may want to look for skills or else. Is it something that will be part of a next release ?
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
9 years 1 month ago #77307
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic How to add custom fields to search query frontend
It is easy to make the extension search for comment field. Please follow instructions below to get it works:
1. Open the file components/com_osmembership/model/members.php
2. Find this line of code
3. Change it to
After that, the system should search for data in comment field, too
Tuan
1. Open the file components/com_osmembership/model/members.php
2. Find this line of code
Code:
$config['search_fields'] = array('tbl.first_name', 'tbl.last_name', 'tbl.email', 'b.title');
3. Change it to
Code:
$config['search_fields'] = array('tbl.first_name', 'tbl.last_name', 'tbl.email', 'tbl.comment', 'b.title');
After that, the system should search for data in comment field, too
Tuan
Please Log in or Create an account to join the conversation.
- Helene Larocque
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 13
- Thank you received: 0
9 years 1 month ago #77309
by Helene Larocque
Replied by Helene Larocque on topic How to add custom fields to search query frontend
Great ! I will try that. I guess I could not update the component anymore after that, isn't it ?
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
9 years 1 month ago #77310
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic How to add custom fields to search query frontend
Just make a backup of that file and restore it after you update to new version !
Tuan
Tuan
Please Log in or Create an account to join the conversation.
- Helene Larocque
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 13
- Thank you received: 0
9 years 1 month ago #77311
by Helene Larocque
Replied by Helene Larocque on topic How to add custom fields to search query frontend
OK. Thanks !
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.