Need help creating searchable data (5.6.3.4)

Permalink
For a website I've been working on they provide contact info for therapists in various states. Previously they just had a big table with all the therapists listed, but I'm trying to replace that with a dropdown list of states that a user can select from, then click a search button, and be presented with a list of therapists from just that state. I've set up an external form that creates the dropdown list and search/submit button. But now I'm stuck.

Do I create a table within the site's database to hold all the data (therapist's name, phone, state, etc.)? Or does it need to go somewhere else?

Once I've got the data entered (somewhere), how do I connect the form on the page to it?

A step-by-step guide on how to do this would be really helpful, I've never tried to do it with concrete5 but it's a function I'd like to use for a lot of things if I could figure out how to do it. I've searched the documentation and the forums here, but not found the info.

OddSpoon
 
JohntheFish replied on at Permalink Reply
JohntheFish
Have a look at my Uber List and Uber Filter addons (they use Magic Data). You could set it up to provide a filterable/searchable list of pages, of users or (with MD forms) of Form responses or a CSV file. Which to use all depends on how you keep your master list of therapists.
hutman replied on at Permalink Reply
hutman
We have handled this in two ways depending on what seems better when we start the build.

1) Use Page Attributes to house the information.

For this option you would add the Page Attributes for all of your information and then use Composer to create pages for each therapist. You could then use the PageList model to gather and filter the information for your search.

2) Create a database table to house the information.

For this option you would need to create a package and in the package you would put a db.xml file which would create your table in the database. You would then need to create one or more pages to enter the information into that database and the models to get/put the information. If you did it this way you would have to build more, but you would not be limited to using pages.

If you have questions or would like an example of either of these feel free to ask.
OddSpoon replied on at Permalink Reply
OddSpoon
Your add-ons look very useful, JohntheFish, I've bookmarked them for future reference. Unfortunately I can't afford to buy add-ons right now, so I'm stuck doing it the hard way around...

Which brings me to your response, hutman. Your option #2 sounds like what I need, and already gives me guidance on how to go about it (Aha! A package with db.xml file!) I would very much like to see an example of how to set things up via this method, thank you.
hutman replied on at Permalink Reply
hutman
This package is a great starter for this -https://github.com/herent/Custom-Objects-in-concrete5-Demo...
OddSpoon replied on at Permalink Reply
OddSpoon
Thanks for that, I've downloaded the package and have been going through it all, and reading the detailed instructions on the associated blog. I'm in way over my head! I understand the structure of the package (basically), and how the database table and the Dashboard end of it is set up, but two things I don't understand are 1) how to add attributes to the custom objects created this way; and 2) the front-end page - I'm completely lost on that part of it. What do I put on that page (using the custom-object-list page type in the example package) to access the objects?
hutman replied on at Permalink Reply
hutman
I'm not sure I understand what you're asking, there aren't any "attributes" on the custom objects, you just put whatever information you need into the database table using the dashboard pages and then use the model files to query those and you can use the results to do whatever you want with the information.
OddSpoon replied on at Permalink Reply
OddSpoon
Thanks, hutman, I'm wrapping my head around these concepts. I haven't found much in the documentation about working with custom objects, but I'm figuring it out.

The problem I'm having right now is with the model files - I can't get them to work. When I go to the page, there is nothing there. It seems to be using the default page template, and none of the material in the model file. Do you have any pointers on using them? Thank you!
hutman replied on at Permalink Reply
hutman
Can you provide some code or something, the model files don't output any HTML so I'm not exactly sure what you're trying to do
ArturLucas replied on at Permalink Reply
Hello guys, i'ved downloaded the package but when i go to the dashboard i get "unable to install" check the controller.php file and make sure it is set for concrete 5.7 or more!!! What do I need to change?
Tks.
ArturLucas replied on at Permalink Reply
I'm working with the 5.7.5.9
i'ved opened the controler.php and tried to update version but it doesn't work
JohntheFish replied on at Permalink Reply
JohntheFish
Most 5.6 packages require a lot more work to make them compatible with 5.7 than simply changing a version number in the controller. If you are not an experienced developer and do not have a lot of time available, you will not be able to do it.