Building a filtering module

Locked
babberoo
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 139
Joined: Wed Jan 23, 2008 5:35 pm

Building a filtering module

Post by babberoo » Mon Aug 11, 2008 4:41 pm

I have a custom built component based on the standard Joomla content sturcture ie Sections = Countries, Categories = Regions

I want to build a custom quick search module that has a dropdown with filtering so that I have Countries, and once one is selected it then shows the list of regions in the next dropdown. I guess that this will either need to reload the page or do it via AJAX?

Next thing, how do I go about retrieving the information from the database? I have the methods setup for my model but how do I access these methods?

CybArc
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Aug 12, 2008 10:03 pm

Re: Building a filtering module

Post by CybArc » Tue Aug 12, 2008 10:13 pm

I'm not sure I understand correctly. Are you wondering where the sections and categories are stored in the database?

I'm also wondering this, which is why I ask. Actually, I'd like to modify the sections to create a parent/sub system. That way the country can be decided by which state/region/province they are in. Then I could use categories for categories of interest in that area.

So back to your question... my thoughts are to go with AJAX. Do you have any AJAX experience? I do not, but if you do not and would prefer not to learn it, I'd be willing to learn it and work out the dropdown boxes for us.

Do you have any experience with Joomla core hacks? I don't know, but I might have to modify the sections/categories setup to get my idea working proper.

Thanks in advance, and I hope I can help.

babberoo
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 139
Joined: Wed Jan 23, 2008 5:35 pm

Re: Building a filtering module

Post by babberoo » Wed Aug 13, 2008 8:00 am

What I've done is take the Joomla content/category/section and duplicated it to store property/region/country using a fairly similar data structure. I've built a front end component that will allow filtering/searching and now wish to create a module so that I can put a 'quick search' on any page. What I wanted to do is to have 2 conditional dropdowns for Country and Region in my module. What I've found is that Joomla comes with some javascript functions called changeDynaList which handles this. You just need to write the PHP to populate a javascript array.

CybArc
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Aug 12, 2008 10:03 pm

Re: Building a filtering module

Post by CybArc » Wed Aug 13, 2008 6:53 pm

That's amazing, truly. How did you duplicate the sections/categories? Are there extra drop-down boxes provided on the "Add New Content" page so as to allow the user to add content into your Country/Region schema?

babberoo
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 139
Joined: Wed Jan 23, 2008 5:35 pm

Re: Building a filtering module

Post by babberoo » Thu Aug 14, 2008 8:18 am

In it's simplest form I just copied and pasted the entire folder structure and started renaming. There are a few changes you need to make but it's possible. The reason I went this way was that most of the functionality I wanted for 'content' was already there, but I didn't want to hack it. I can then also create a component from it and be able to uninstall it and update it discretely.

CybArc
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Aug 12, 2008 10:03 pm

Re: Building a filtering module

Post by CybArc » Thu Aug 14, 2008 4:26 pm

Good to know, then. I'd like to find a way to integrate Countries and States much the way Sections and Categories are currently implemented. I just upgraded to 1.5 so I can follow all the tutorials on Joomla extension creation.


Locked

Return to “Joombie Coding Q/A”