is there a separator symbol I can be using (like commas for Tags) to break up multiple text answers into smaller, searchable/matchable answers?
For example, if one of the fields is "Favorite Sports Teams" and someone answers New York Yankees, Dallas Cowboys, Miami Heat, Ohio State. As it is now, the entire answer is all as one when ideally it should be 4 different ones, each able to be searched and matched.
yes, I searched before asking.... |
not knowing exactly what you want to do, but based off of your example - I would create a predefined list called FootballTeams. It would be a list of all the NFL teams. I would use a Multiple Selector field (I am using the box in my pics). This will allow users to select multiple teams, and allow an extensive search as it adds Plus signs to search for multiple criteria. For example: If I wanted to find those who liked the New Orleans Saints, and the Dallas Cowboys, I could do so and it would return just those results.
I hope that gives you some ideas
caredesign.net |
Yes, you could use a multiple selector; you would have to hard code in values. If you are wanting an input box, the profile builder does not have a multiply settings (you may have seen areas in Dolphin where you can add another text box; such as with adding more than one category to something). However, you can post process the data from the Sports Teams profile field to add in the line breaks and then display that. Deano helped me with changing plain text email and urls into clickable ones with post processing the profile view data. Geeks, making the world a better place |
With Professor's idea, you get exact data input from your members too since they are selecting from a predefined list. His solution is the easiest to implement and everyone's data will match since you will hard code in the teams. Geeks, making the world a better place |
wont work. way too many variables in the answers to do it so almost needs to be text. no way I'm going to populate all those answers (just think of all the pro & college teams around the world), not to mention I want to use text fields as additional "other" fields for checkbox lists that I did populate (like Interests & Activities)
use a selector (dropdown) - this will allow the user to add entries. Then it will be treated separately.
yes, I searched before asking.... |
just to share a workaround until I find an answer, I'm using the text fields in the matching questionnaire (on pdeit) but not in the search form. the only place the answers now show up is in the General Info block on the Profile page.
....another solution that's far from ideal, especially because using the previous example as a test case I ran a keyword search for Yankees from another account and nothing came up. Any idea why its coming up blank? (Yes, searchable is checked in the Field Builder & Profile was checked on the Keyword search)
it really is ponderous that there is no standard separator
yes, I searched before asking.... |
just to share a workaround until I find an answer, I'm using the text fields in the matching questionnaire (on pdeit) but not in the search form. the only place the answers now show up is in the General Info block on the Profile page.
....another solution that's far from ideal, especially because using the previous example as a test case I ran a keyword search for Yankees from another account and nothing came up. Any idea why its coming up blank? (Yes, searchable is checked in the Field Builder & Profile was checked on the Keyword search)
it really is ponderous that there is no standard separator
Actually there is; just not with the profile fields builder. A multiplyable input field will store each entry into the database with a semicolon separating the entries; the user sees a + icon to add a new text input box; as many as they need. When the data is read from the multplyable field, it is stored as a single entry in the database with the values separated by a semicolo.
The solution is to do post processing on team field so when you present it in the block on the profile view page it will list each on a separate line. You instruct your users to enter each team separated by a comma.
Geeks, making the world a better place |
OK, here's another solution that I personally use - now that there is a bit more info on what you are doing. If not using the 'Tags' then rename the 'Tags' to 'Teams' in the language keys. In my usage, I have renamed 'Tags' to '(Health) Issues'. And since Tags should be working with the search that should be able to resolve your problem. caredesign.net |
Actually there is; just not with the profile fields builder. A multiplyable input field will store each entry into the database with a semicolon separating the entries; the user sees a + icon to add a new text input box; as many as they need. When the data is read from the multplyable field, it is stored as a single entry in the database with the values separated by a semicolo.
The solution is to do post processing on team field so when you present it in the block on the profile view page it will list each on a separate line. You instruct your users to enter each team separated by a comma.
I think you are telling that what what I want can be done, just not how/where I know how. what do you mean by "post processing"?
OK, here's another solution that I personally use - now that there is a bit more info on what you are doing. If not using the 'Tags' then rename the 'Tags' to 'Teams' in the language keys. In my usage, I have renamed 'Tags' to '(Health) Issues'. And since Tags should be working with the search that should be able to resolve your problem.
I wasn't using it and BIG thanks, that appeared to work. The results still show as a single text answer on the profile page view but the individual answers are coming up in searches.
Next questions:
1- will I screw up the functionality if I rename the Field?
2- is there any way to clone the Tags Field so I can use the functionality a few times instead on just the one?
TIA
yes, I searched before asking.... |
I was waiting to see if you wanted to start digging into code or not. The thing about changing core files is that you have to keep a record so that you know what you changed so you can issue upgrades.
For an idea of what I meant see this topic:
http://www.boonex.com/forums/?action=goto&search=1#topic/Turn-Email-Address-in-Profile-to-Clickable-Mailto.htm
Geeks, making the world a better place |
I'm smart enough to know when I'm not smart. Unless is something simple like html code, I leave it up to professionals knowing I'm much more likely than not to F it up. That's why I don't even want to edit the system name for the repurposed Tag Field without knowing that I will screw up the functionality.
If there is a way to clone that Tag Field, it would be the simplest solution for me.
yes, I searched before asking.... |
Searchable Fields module - exactly what you're asking for:
http://www.boonex.com/m/Searchable_fields
|
not exactly. I have that mod installed too and its great, but doesn't do what I'm looking for in this thread.
Searchable Fields module - exactly what you're asking for:
http://www.boonex.com/m/Searchable_fields
---- IS THERE ANY WAY TO CLONE THE "TAGS" PROFILE FIELD????
yes, I searched before asking.... |
Changing the language key values of Tags to whatever will not affect any functionality. But, you will have to really look into the site and see how to duplicate the tags functions. If I have time, I will look into it. But do not hold your breathe as I am now working a full time job so my developing has been drastically reduced. caredesign.net |
I am now working a full time job
Congrats on the full time job; while you may have less free hours, you have more income which means more financial security.
Geeks, making the world a better place |
I had a few minutes and was curious about duplicating the Tags section, so I tried it. Surprisingly, most of it is working. I am not totally finished finding all of the tweaks, though. So far, the input and display on the profile page work. I have not checked out the search and the page that displays all of the (Tags).
EDIT: I got the search part working now. Gonna work on the page that displays all of the (Tags) tomorrow.
caredesign.net |
fantastic
I'll eagerly be waiting on the results
:popcorn:
I had a few minutes and was curious about duplicating the Tags section, so I tried it. Surprisingly, most of it is working. I am not totally finished finding all of the tweaks, though. So far, the input and display on the profile page work. I have not checked out the search and the page that displays all of the (Tags).
EDIT: I got the search part working now. Gonna work on the page that displays all of the (Tags) tomorrow.
yes, I searched before asking.... |
If the idea is to simply list the sports teams the members enter in a column instead of a row, I could go look at the code and tell you what to place in to add in the line breaks. Sounds much easier to me than trying to clone the tags and use it for something as simple as adding line breaks. Geeks, making the world a better place |
@GG - I believe one of the major concerns is the searchablilty. While your suggestion is a great one - how would the search work if done that way.
@FFP But as an FYI - there were quite a few changes I had to make - not really many to the core files (so far I have only modified the inc/utils.inc.php page). Pretty much, all I have done so far is to find all pages with Tag in the name, and I duplicated and renamed mine to Idea. Then on each of the new pages, changed all instances of tag to idea (keeping capitalizations). I know you said you were not comfortable with making changes to core files, but it seems other than GG's option, it would be quite a bit to do. Once I figure everything out, I will post a zip of all the new files with instructions on what files need to be changed.
caredesign.net |
@GG - I believe one of the major concerns is the searchablilty. While your suggestion is a great one - how would the search work if done that way.
It is only a view, search is done on the database fields. Question should be if having multiple items in a database field separated by a comma, or semicolon, affects the search results.
Geeks, making the world a better place |
@GG - I believe one of the major concerns is the searchablilty. While your suggestion is a great one - how would the search work if done that way.
It is only a view, search is done on the database fields. Question should be if having multiple items in a database field separated by a comma, or semicolon, affects the search results.
Yes it can be done. It is used a lot - such as tags and keyword. The sql query searches the database for any instance where the search term is included anywhere in the database table field. Like so:
'tag' => array('value' => '', 'field' => 'tags', 'operator' => 'against'),
and
$this->aCurrent['restriction']['keyword'] = array('value' => $sValue,'field' => '','operator' => 'against');
Now, how would this be worked out so that the default search does the search, and not have to rewrite a new search for that new field. This is the point where I ran into problems. I just could not conceptualize how to do it - which is when I decided to just duplicate the existing Tags and see if that worked.
caredesign.net |
After thinking about this a bit more - I believe I may have jumped down a rabbit hole. One thing I did not take into consideration is peoples stupidity. And because of this factor - it may be more beneficial to use a clone of the Categories instead of the Tags. At least this way, you have more control over the data and can correct any misspellings. Then it is displayed in a dropdown selector with option too add multiple, and it is displayed in a comma separated list. Also making the spelling correct for everyone (unless you misspell a name) - but it will be consistent. That would also have an affect on the searching. If I say I like the Chicago Nulls, and you search for Bulls - my answer will not show up. Although I actually meant Chicago Bulls.And don't forget the added bonus of being able to click a teams name and see other members who "Like" that team.
Just a thought.
caredesign.net |
I say follow Deano's example. The problem is that the field does not accept html markup; so you add the markup in post processing of the profile view before it is sent to the browser. Change the field to html and change the commas to <br /> using preg_replace(). Now the sports teams are in a nice vertical list.
Or just change the field from text to textarea and turn on the tinymce but I think the idea is not to have the members try to format the sports teams list.
Geeks, making the world a better place |
??????? Where is Deano's example. Was it deleted or something? Plus - I have some sense of php and javascript and stuff, but what you wrote confused the heck out of me.
I say follow Deano's example. The problem is that the field does not accept html markup; so you add the markup in post processing of the profile view before it is sent to the browser. Change the field to html and change the commas to <br /> using preg_replace(). Now the sports teams are in a nice vertical list.
Or just change the field from text to textarea and turn on the tinymce but I think the idea is not to have the members try to format the sports teams list.
caredesign.net |
??????? Where is Deano's example. Was it deleted or something? Plus - I have some sense of php and javascript and stuff, but what you wrote confused the heck out of me.
I say follow Deano's example. The problem is that the field does not accept html markup; so you add the markup in post processing of the profile view before it is sent to the browser. Change the field to html and change the commas to <br /> using preg_replace(). Now the sports teams are in a nice vertical list.
Or just change the field from text to textarea and turn on the tinymce but I think the idea is not to have the members try to format the sports teams list.
Nevermind; I think I misunderstood the question of what the guy wanted to do in the first place. I am not even sure the problem existed in the first place; I think it was more of a misunderstanding of how Dolphin works.
Geeks, making the world a better place |
Create a new field in the profile builders section and use text as the input type. Then edit a profile and add 3 different values in that field - separate each with a comma. Now, do a search for any of the values in that field. You will get no results. If you search for the complete entry - all 3 values with the separating comma - then you will get results. The goal is to get results if only one value is searched for. Currently the Tags would be the exact thing that is wanted, but there are more than one field that is needed like this. caredesign.net |
OK - I will admit - sometimes I can be a doofball and have to do things the long and hard way before I realize the short and easy way.
So - to answer your question for real this time - this is what I have found. It does require a slight modification to the core files - but just one. After you have created your field in the profiles builder, (keep track of what you named the field in the System Name) go to templates/base/scripts/BxBaseSearchProfile.php. around line 17 you should see something like this:
'ownFields' => array('ID', 'NickName', 'NickName', 'Headline', 'DescriptionMe', 'Country', 'City', 'Tags', 'DateReg', 'DateOfBirth', 'Sex', 'Couple'), 'searchFields' => array('NickName', 'Headline', 'DescriptionMe', 'City', 'Tags'),
add the name of the new field to these lines like such (maintain same case as you have in System Name):
'ownFields' => array('ID', 'NickName', 'NickName', 'Headline', 'DescriptionMe', 'Country', 'City', 'Tags', 'DateReg', 'DateOfBirth', 'Sex', 'Couple', 'MultipleField'), 'searchFields' => array('NickName', 'Headline', 'DescriptionMe', 'City', 'Tags', 'MultipleField'),
now when doing a search for any of the values, it should work. You can add all of your new fields this way for them to be used in the search.
caredesign.net |
So it was just a matter of adding the fields to the array. Thanks Professor; I think this will come in handy on another site that I help to manage. Geeks, making the world a better place |
it looks that way. Working on a solution for this was also needed in my project. There were fields that we have with multiple answers that were not getting displayed in the results, so I had to figure it out anyways. Just wish I had realized that in the beginning. It was "how to do this for the modules, without having to modify every module". When I realized I couldn't and it was only going to be on the profile page, then I realized to add the field to the array. But what confused me is that if you type in the complete entry (all values with comma) then it would display. And that is with the fields not being in the array. Although it works, I am not 100% sure it is correct. So, i can only say "Use at your own risk". With the amount of customizations needed to really make Dolphin 'Your Own' I have no idea how this edit will affect or be affected by other changes. caredesign.net |
thanks guys. I'll pass this along to my developer and will post back in this thread at some time in the future either ratifying the positive results or bringing up any issues that arise.
again, the time and effort spent on coming up (and sharing) a solution that has application not just to me but to the boonex community is much appreciated
yes, I searched before asking.... |